tracing a path using plot

6 Ansichten (letzte 30 Tage)
cgo
cgo am 20 Okt. 2015
Beantwortet: Walter Roberson am 20 Okt. 2015
I want to see a line being traced on screen as the loop is running.
x=0; y=0;
for t=1:0.01:10
plot(x+t, y+t, 'red')
hold on
end
In the code above, it just shows the 'end result' which is a graph of a straight line. I want to run it like a 'movie'. What should I have added?

Antworten (1)

Walter Roberson
Walter Roberson am 20 Okt. 2015
for t=1:0.01:10
plot(x+t, y+t, 'red')
hold on
drawnow()
end

Kategorien

Mehr zu Mathematics finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by