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!