for文で得た値をplotしたい
Show older comments
for文で0~3000回姿勢計算を行い、その一回ごとの結果をplotしてグラフにしたいのですが、どのように配列すればいいのでしょうか。
for i = 0 : 0.001 : 3
R = R + r *0.001
end
a=~;b=~;c=~;
上のa,b,cを3000ずつplotしたいです。
3 Comments
Hernia Baby
on 30 May 2021
rはiでよろしいでしょうか? またa,b,cはRに格納されており、i-1は保持されますか? それとも更新し、過去の情報は消しますか?
Jun Ozaki
on 30 May 2021
Hernia Baby
on 30 May 2021
返信ありがとうございます。
自分の勘違いで更新はwhile文にする必要があると思い込んでいました。
確認しましたが、for文でも可能でした。
プロットはhold on状態でなければ、for文内に組み込むことでプロット可能です。
hold onの場合は事前のプロットが保持されます。
遷移をゆっくり見たい場合は、回答に入れました通り、pause関数でしばらく次の計算を待つことができます。
Accepted Answer
More Answers (0)
Categories
Find more on Annotations in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!