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?

답변 (1개)

madhan ravi
madhan ravi 2018년 10월 24일
편집: madhan ravi 2018년 10월 24일

0 개 추천

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

댓글 수: 7

Image Analyst
Image Analyst 2018년 10월 24일
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
madhan ravi 2018년 10월 24일
thank you sir Image Analyst couldn't get rid of this habit
sam moor
sam moor 2018년 10월 24일
Giving error as
Attempt to grow array along ambiguous dimension.
madhan ravi
madhan ravi 2018년 10월 25일
Upload your code
sam moor
sam moor 2018년 10월 25일
Attached the code
sam moor
sam moor 2018년 10월 29일
any thoughts??
per isakson
per isakson 2018년 10월 29일
Two thoughts

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

카테고리

도움말 센터File Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

질문:

2018년 10월 24일

댓글:

2018년 10월 29일

Community Treasure Hunt

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

Start Hunting!

Translated by