How to use multiple outputs from function
9 ビュー (過去 30 日間)
古いコメントを表示
採用された回答
その他の回答 (1 件)
Matt J
2014 年 11 月 18 日
編集済み: Matt J
2014 年 11 月 18 日
I assume you want to do the summation outside the workspace, for some reason . If so, then,
outputsRequested=2;
[c{1:outputsRequested}]=rowcolumn(a,b);
result = sum([c{:}])
2 件のコメント
Matt J
2014 年 11 月 18 日
You can later assign the output to separate variables if you wish,
x=c{1}
y=c{2}
but why you wouldn't simply use c{1} and c{2} instead of separate variables x and y is not clear.
参考
カテゴリ
Help Center および File Exchange で Cell Arrays についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!