How to use multiple outputs from function
Show older comments
function[x,y]=rowcolum(a,b)
x=max(sum(a,2));
y=min(sum(b,1));
end
how to write a code that will sum x+y in main script?
Accepted Answer
More Answers (1)
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{:}])
Categories
Find more on Cell Arrays 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!