how to write function with indefinite number of outputs?
1 view (last 30 days)
Show older comments
I know how to write function of one or multiple outputs. But there are lots of function in MATLAB which can be used with one and multiple outputs also. How to handle such feature?
0 Comments
Accepted Answer
Walter Roberson
on 13 Sep 2015
You check nargout to see how many outputs there are, and you make assignments to varargout{K} for the K'th output.
0 Comments
More Answers (0)
See Also
Categories
Find more on Argument Definitions in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!