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!