storing only part of the output of a function with multiple outputs

1 回表示 (過去 30 日間)
Jeong Ho
Jeong Ho 2015 年 3 月 3 日
コメント済み: Star Strider 2015 年 3 月 4 日
Suppose you have a function with many outputs, e.g.,
[C,ia] = setdiff(A,B)
I am only interested in ia and not C. Is there some way of only calling on ia without storing C? Thank you very much!

採用された回答

Star Strider
Star Strider 2015 年 3 月 3 日
Use the tilde ‘~’ to suppress outputs you don’t need.
In this instance:
[~,ia] = setdiff(A,B)

その他の回答 (1 件)

Jeong Ho
Jeong Ho 2015 年 3 月 3 日
Dear Star Strider, Thank you so much; works like a charm!
Best, John

カテゴリ

Help Center および File ExchangeMATLAB についてさらに検索

製品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by