How to plot two vectors while pausing between plotted points

Hey guys, I currently have these lines of code to plot a trajectory with two vectors (North and East coordinates). It works well when I plot them normally, but when I try to plot them with time (there is a time associated with each pair of points stored in vector time1), the plot remains blank. I see the axis moving and time passing as I would like, it just doesn't plot anything... what should I do? :/
figure(1)
for k=1:(length(time1)-1)
disp(time1(k))
plot(S_1E(k),S_1N(k),'LineWidth',2.5);
title( sprintf('t = %.1f', time1(k)) );
hold all
pause((time1(k+1)-time1(k)));%/1 is for real time - use higher number to run faster
end
hold off

回答 (1 件)

madhan ravi
madhan ravi 2018 年 10 月 15 日

0 投票

figure(1)
for k=1:(length(time1)-1)
disp(time1(k))
plot(S_1E(k),S_1N(k),'LineWidth',2.5);
title( sprintf('t = %.1f', time1(k)) );
hold all
pause(0.1);%/1 is for real time - use higher number to run faster
end
hold off

6 件のコメント

Marília Matos
Marília Matos 2018 年 10 月 15 日
Thank you, but it still doesn't plot anything
madhan ravi
madhan ravi 2018 年 10 月 15 日
Upload your datas
madhan ravi
madhan ravi 2018 年 10 月 15 日
編集済み: madhan ravi 2018 年 10 月 15 日
Attach S1_E and S1_N as a file instead of pasting such long lines here
Marília Matos
Marília Matos 2018 年 10 月 15 日
編集済み: Marília Matos 2018 年 10 月 15 日
Files I am sorry, I exceeded the number of uploads and this was the only way I found to send you the data
madhan ravi
madhan ravi 2018 年 10 月 15 日
Upload it as text file instead of pasting the numbers as comments that what I meant

サインインしてコメントする。

カテゴリ

ヘルプ センター および File ExchangeGraphics Objects についてさらに検索

タグ

質問済み:

2018 年 10 月 15 日

コメント済み:

2018 年 10 月 15 日

Community Treasure Hunt

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

Start Hunting!

Translated by