How to use multiple outputs from function
Mostrar comentarios más antiguos
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?
Respuesta aceptada
Más respuestas (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{:}])
Categorías
Más información sobre Cell Arrays en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!