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 commentaire

ES
ES le 18 Oct 2013
Modifié(e) : ES le 18 Oct 2013
What is 'Work'?

Connectez-vous pour commenter.

 Réponse acceptée

Azzi Abdelmalek
Azzi Abdelmalek le 18 Oct 2013

0 votes

Use Work{i} instead of Work(i)

Plus de réponses (1)

Andrei Bobrov
Andrei Bobrov le 18 Oct 2013

0 votes

for ii = 1:5, Work{ii}=Constant.*Test{1,ii}.data.*Increment; end

Catégories

En savoir plus sur Loops and Conditional Statements dans Centre d'aide et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by