フィルターのクリア

Calling some MATLAB function with suppressed outputs

5 ビュー (過去 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 Center および File ExchangeLoops and Conditional Statements についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by