Azzera filtri
Azzera filtri

Plot a figure as time progresses?

5 visualizzazioni (ultimi 30 giorni)
Hancheol
Hancheol il 29 Apr 2013
Hi
I wanna plot a figure sequentially as time progresses.
For example if we plot
t=0:0.1:10; x=t.^2; plot(t,x);
then we have only a curve.
But I wanna have a figure that starts at the origin and ends at (10,100).
Is there any method or command to do this?
Thanks.

Risposta accettata

Azzi Abdelmalek
Azzi Abdelmalek il 29 Apr 2013
t=0:0.1:10;
x=t.^2;
figure;
hold on
xlim([min(t) max(t)])
ylim([min(x) max(x)])
for k=1:numel(t)
plot(t(k),x(k));
pause(0.1)
end
  1 Commento
Hancheol
Hancheol il 29 Apr 2013
I found the command.
It was 'comet.'
But your answer was also helpful.
Thanks. :)

Accedi per commentare.

Più risposte (1)

Sachin Ganjare
Sachin Ganjare il 29 Apr 2013
  1 Commento
Hancheol
Hancheol il 29 Apr 2013
Thanks for your answer.
Yours was also helpful, but the answer below seemed more direct and simple to me.
But I wanna say thank you, too. :)

Accedi per commentare.

Categorie

Scopri di più su 2-D and 3-D Plots in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by