Is it possible to use a function with 2 outputs and sometimes with 4 outputs?
古いコメントを表示
And how to order the output variables? [x1,x2,x3,x4] = f(); or [x4,x3,x2,x1] = f();
2 件のコメント
Stephen23
2018 年 7 月 26 日
"Is it possible to use a function with 2 outputs and sometimes with 4 outputs?"
Yes.
"And how to order the output variables?"
The order of the output arguments is determined by how they are defined in the function itself. What you call them in the calling workspace is totally irrelevant.
Adam Danz
2018 年 7 月 26 日
Also see
help varargout
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Debugging and Improving Code についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!