hi,
why do I get too many output arguments here? C is a matrix
[m, n]=size(C);
for i=1:1:n
j=i:m
[wert, wo]=[abs(max(C(:,i)))], [i:1:m]
end

 채택된 답변

Walter Roberson
Walter Roberson 2020년 8월 26일

0 개 추천

you cannot assign to multiple variables using the syntax
[A, B] = [C], [D]
To assign to multiple variables then you need one right hand side, which has to be of the form:
  1. a function that returns multiple outputs, like max can but abs cannot
  2. a structure expansion
  3. a cell expansion
  4. deal() -- which is really just a function that returns multiple outputs
You could turn what you have into a call to deal(). I do not especially recommend that, as I find it less clear than multiple assignment statements.

댓글 수: 1

Walter Roberson
Walter Roberson 2020년 8월 26일
Which of the four cases I listed do you consider your [wert, wo]=[k, z] line to be?

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Parallel Computing Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by