How to save each iteration in cell array?
Mostrar comentarios más antiguos
I am using for loop for each folders to save the value in each iteration. But, the problem is: it overrides the value and save only last iteration. How do I save each iteration in cell array for each folder in for loop?
Respuestas (1)
madhan ravi
el 24 de Oct. de 2018
Editada: madhan ravi
el 24 de Oct. de 2018
c=cell(zeros(1,12))
for ii = 1:12. %edited after sir Image Analyst's comment
c{ii}= %do something;
end
7 comentarios
Image Analyst
el 24 de Oct. de 2018
To avoid problems when one might encounter complex numbers, it's usually advised to use "k" or "index" or "ii" or something for the loop iterator variable instead of i and j (the imaginary variables).
madhan ravi
el 24 de Oct. de 2018
thank you sir Image Analyst couldn't get rid of this habit
sam moor
el 24 de Oct. de 2018
madhan ravi
el 25 de Oct. de 2018
Upload your code
sam moor
el 25 de Oct. de 2018
sam moor
el 29 de Oct. de 2018
per isakson
el 29 de Oct. de 2018
Two thoughts
- Always provide the full error message. output is assigned values in many places
- See Debug a MATLAB Program and Examine Values While Debugging. It's tricky to spot the problem without being able to run the code.
Categorías
Más información sobre Loops and Conditional Statements en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!