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

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 comentario

ES
ES el 18 de Oct. de 2013
Editada: ES el 18 de Oct. de 2013
What is 'Work'?

Iniciar sesión para comentar.

 Respuesta aceptada

Azzi Abdelmalek
Azzi Abdelmalek el 18 de Oct. de 2013

0 votos

Use Work{i} instead of Work(i)

Más respuestas (1)

Andrei Bobrov
Andrei Bobrov el 18 de Oct. de 2013

0 votos

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

Categorías

Más información sobre Performance and Memory en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 18 de Oct. de 2013

Comentada:

el 18 de Oct. de 2013

Community Treasure Hunt

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

Start Hunting!

Translated by