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!

 채택된 답변

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일

0 개 추천

Dear Star Strider, Thank you so much; works like a charm!
Best, John

카테고리

도움말 센터File Exchange에서 Get Started with MATLAB에 대해 자세히 알아보기

제품

질문:

2015년 3월 3일

댓글:

2015년 3월 4일

Community Treasure Hunt

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

Start Hunting!

Translated by