How to save each iteration in cell array?

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?

Answers (1)

madhan ravi
madhan ravi on 24 Oct 2018
Edited: madhan ravi on 24 Oct 2018
c=cell(zeros(1,12))
for ii = 1:12. %edited after sir Image Analyst's comment
c{ii}= %do something;
end

7 Comments

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).
thank you sir Image Analyst couldn't get rid of this habit
Giving error as
Attempt to grow array along ambiguous dimension.
Upload your code
any thoughts??
Two thoughts

Sign in to comment.

Categories

Find more on Loops and Conditional Statements in Help Center and File Exchange

Asked:

on 24 Oct 2018

Commented:

on 29 Oct 2018

Community Treasure Hunt

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

Start Hunting!