tracing a path using plot

조회 수: 17 (최근 30일)
cgo
cgo 2015년 10월 20일
답변: Walter Roberson 2015년 10월 20일
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?

답변 (1개)

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

카테고리

Help CenterFile Exchange에서 Annotations에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by