필터 지우기
필터 지우기

Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

A(I) = B, the number of elements in B and I must be the same.

조회 수: 1 (최근 30일)
bugatti79
bugatti79 2013년 10월 22일
마감: MATLAB Answer Bot 2021년 8월 20일
Hi Folks,
I have nu_1= 18*9*6 matrix where each page has the same numeric value, ie page 1 all elements =25, page 2 all elements =50 etc.
I am trying to call in each page in a for loop using
for ii=1:size(nu_1,3)
i = nu_1(1,1,ii);
Calcs(ii)= Z.*i...etc
end
where z is an 18*9 matrix and i appears to be a 1*1.
How do I modify i such that it becomes an 18*9 matrix (and updates for each ii) because currently i get the error as outlined in the subject header.
Thanks in advanced B

답변 (1개)

Walter Roberson
Walter Roberson 2013년 10월 22일
nu_1(:,:,ii)
but note that the result of the right hand side of Calcs would be an 18x9 matrix, and you are trying to store that entire matrix into the single location Calcs(ii). This is the same basic error you are getting with your existing code.
  댓글 수: 1
bugatti79
bugatti79 2013년 10월 22일
Do I change
Calcs(ii) to Calcs{ii}
Thanks B

이 질문은 마감되었습니다.

Community Treasure Hunt

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

Start Hunting!

Translated by