Undefined operator '+' for input arguments of type 'cell'

조회 수: 1 (최근 30일)
VISHALI V
VISHALI V 2018년 2월 14일
댓글: Walter Roberson 2018년 2월 14일
sum(k)={0};
for j=1:K
for i=1:K
if(j~=i)
sum(j)=(sum(j))+(f(i))
end
end
end
  댓글 수: 2
Walter Roberson
Walter Roberson 2018년 2월 14일
Why are you initializing sum(k)={0}; instead of sum(k)=0 ? Are you expecting f(i) to return matrices of different sizes according to i? (If so then it is not clear what it would mean to add those.)
Walter Roberson
Walter Roberson 2018년 2월 14일
About 2 1/2 weeks from now, you are going to try to use the function sum and then get very confused by an error message about indices needing to be positive integers or logical.

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

답변 (0개)

카테고리

Help CenterFile Exchange에서 Wireless Communications에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by