Plotting separate points on the same graph while your program is running
9 ビュー (過去 30 日間)
古いコメントを表示
Hi everyone,
I would like to find out if anyone knows how to plot points on a graph while the program is executing...
I have a for loop and each value of j gives me a different value of r. At the end of it, i would like to plot r (x-axis) against j (y-axis).
For example,
for j=1:5
%processes to find r..
r = %a certain value;
end
plot (r,j);
i cant seem to be able to get it done..
0 件のコメント
採用された回答
Héctor Corte
2012 年 1 月 17 日
Try this code:
for j=1:5
%processes to find r..
r = %a certain value;
plot (r,j);
%plot must be inside the loop or you onlye get one value of j and r.
hold on
%with this every new point adds to current graph instead of deleting it.
end
その他の回答 (0 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!