for文で得た値をplotしたい
Afficher commentaires plus anciens
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 commentaires
Hernia Baby
le 30 Mai 2021
rはiでよろしいでしょうか? またa,b,cはRに格納されており、i-1は保持されますか? それとも更新し、過去の情報は消しますか?
Jun Ozaki
le 30 Mai 2021
Hernia Baby
le 30 Mai 2021
返信ありがとうございます。
自分の勘違いで更新はwhile文にする必要があると思い込んでいました。
確認しましたが、for文でも可能でした。
プロットはhold on状態でなければ、for文内に組み込むことでプロット可能です。
hold onの場合は事前のプロットが保持されます。
遷移をゆっくり見たい場合は、回答に入れました通り、pause関数でしばらく次の計算を待つことができます。
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Annotations dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!