Azzera filtri
Azzera filtri

How to draw a line using drawnow command?

1 visualizzazione (ultimi 30 giorni)
Karupothula Prashanth
Karupothula Prashanth il 20 Mag 2013
Here is the code I have computed y and I need to plot it with respect to x. for r=2:length(x); plot(x(r-1),y(r-1),'--') plot(x(r),y(r),'--'); hold on drawnow; end butthie is giving me dotted line instead of a dashed line

Risposte (1)

Iain
Iain il 20 Mag 2013
You should change your plot command to:
plot(x,y,'.-')
If you want it to centre start at (0,0), you can instead have:
plot(x-x(1),y-y(1), '.-')
Change the '.-' as suited for your desired plot style.
drawnow only tells matlab to actually draw the graph, which is important if you want to see the chart being generated while matlab can keep executing other code

Categorie

Scopri di più su Graphics Performance in Help Center e File Exchange

Tag

Non è stata ancora inserito alcun tag.

Community Treasure Hunt

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

Start Hunting!

Translated by