필터 지우기
필터 지우기

Calling some MATLAB function with suppressed outputs

조회 수: 1 (최근 30일)
Marko Gulin
Marko Gulin 2015년 5월 11일
답변: Marko Gulin 2015년 5월 11일
Hello all!
Let's say that we want to call some user-defined MATLAB function as:
[x, ~, y] = my_function(inputs);
where second output of the function is suppressed. Is there any way for function my_function to know which outputs are suppressed?
Best, Marko.

채택된 답변

Alfonso Nieto-Castanon
Alfonso Nieto-Castanon 2015년 5월 11일
Unfortunatley there is not (as far as I know; see for example this thread )
Depending on what you need that functionality for you might achieve a similar result using variable number of outputs and checking the number of outputs requested by the caller (see varargout and nargout) and/or using additional input arguments specifying which particular combination of outputs you would like to have...

추가 답변 (1개)

Marko Gulin
Marko Gulin 2015년 5월 11일
Thank you for your quick answer!

카테고리

Help CenterFile Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by