필터 지우기
필터 지우기

Updating new value in a loop

조회 수: 2 (최근 30일)
Jing Hua
Jing Hua 2012년 8월 7일
I have original x-cell and y_cell
for big_loop=1:100
for...
for...
if
。。。。。。。
after a series of operation
I have a new x_cell and y_cell
end
now I need to put x_cell and y_cell again in the loop, I thought it will update automatically, but some of them have been updated but some are not,dimension error, why there is a dimension error, for every time, x_cell and y_cell should be a new value.
I tried to remove the big loop, and it works with no problem, but only do it one, I need to do that for several times, until certain criterion is reached.
how should I do that?

답변 (1개)

Muruganandham Subramanian
Muruganandham Subramanian 2012년 8월 7일
Hi,
You can do it by padding the data of x_cell and y_cell values by zeros or ones(If you know precise data length of x_cell and y_cell ) initially.
e.g. x_cell=zeros(size(x_cell))
  댓글 수: 2
Jing Hua
Jing Hua 2012년 8월 7일
I will have go for it, thank you for the response.
Jing Hua
Jing Hua 2012년 8월 7일
Still doesn't work. Anyway, thanks a lot

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

카테고리

Help CenterFile Exchange에서 Dialog Boxes에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by