Simple explanation - how to use varargout
이전 댓글 표시
Can anyone give me a simple example of how to use the varargout function? I can't seem to get it to work. The code I've tried looks like this:
[varargout]=fxn_name(x)
if condition, varargout(1)={P}, end
if condition 2, varargout(2)={Q}, end
I tried the above code and the output is always the last calculation that was made in the function file. (ex. the output is ans=N, if N was the last value to be evaluated in the function file).
I've tried reading some of the examples on the web but I can't make heads or tails out of them. Thanks for any help.
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Logical에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!