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

1 vue (au cours des 30 derniers jours)
Jeong Ho
Jeong Ho le 3 Mar 2015
Commenté : Star Strider le 4 Mar 2015
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!

Réponse acceptée

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

Plus de réponses (1)

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

Catégories

En savoir plus sur Structures dans Help Center et File Exchange

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by