How to store iterative information to a matrix?
1 回表示 (過去 30 日間)
古いコメントを表示
I have the following code structure:
while y ~= 0 %y will converge to zero eventually
[x,y] = somefunction(a,b);
iteration = iteration + 1;
this_row(iteration, y);
end
What is the best way to store "this_row" so it can be used for a table or graph?
0 件のコメント
回答 (1 件)
Matt J
2021 年 10 月 18 日
The following is pretty typical.
result=nan(big_number,1);
while abs(y)>=small_number &iteration<big_number
[x,y] = somefunction(a,b);
iteration = iteration + 1;
result(iteration)=this_row(iteration, y);
end
0 件のコメント
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!