필터 지우기
필터 지우기

Using .data{1,i} in a for loop

조회 수: 5 (최근 30일)
bugatti79
bugatti79 2013년 10월 18일
댓글: bugatti79 2013년 10월 18일
Hi Folks,
I have a 1*12 cell array which contains twelve 1*1 struct arrays. Each of which subsequently contains a matrix and it is in the form
Test{1,i}.data
I am struggling to implement the above line in a for loop. Here it is
for i=1:5
Work(i)=Constant.*Test{1,i}.data.*Increment;
end
I get error stating "In an assignment A(I) = B, the number of elements in B and I must be the same." Any ideas?
Thanks in advance B
  댓글 수: 1
ES
ES 2013년 10월 18일
편집: ES 2013년 10월 18일
What is 'Work'?

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

채택된 답변

Azzi Abdelmalek
Azzi Abdelmalek 2013년 10월 18일
Use Work{i} instead of Work(i)

추가 답변 (1개)

Andrei Bobrov
Andrei Bobrov 2013년 10월 18일
for ii = 1:5, Work{ii}=Constant.*Test{1,ii}.data.*Increment; end
  댓글 수: 1
bugatti79
bugatti79 2013년 10월 18일
Thank you both guys

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

카테고리

Help CenterFile Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by