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

2 次查看(过去 30 天)
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 CenterFile Exchange 中查找有关 Get Started with MATLAB 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by