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

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!

 Respuesta aceptada

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

Más respuestas (1)

Jeong Ho
Jeong Ho el 3 de Mzo. de 2015
Dear Star Strider, Thank you so much; works like a charm!
Best, John

Categorías

Más información sobre Get Started with MATLAB en Centro de ayuda y File Exchange.

Productos

Preguntada:

el 3 de Mzo. de 2015

Comentada:

el 4 de Mzo. de 2015

Community Treasure Hunt

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

Start Hunting!

Translated by