looking to have 2 lines, same length, with the angle changing between them? Cant figure out how to animate this?
조회 수: 1 (최근 30일)
이전 댓글 표시
답변 (1개)
Image Analyst
2014년 11월 25일
Use a for loop, line(), and pause(). If the lines are connected, you can use line() once. If the line segments are not touching, then it's probably easiest to call line twice with "hold on" in between (or else separate the two segments with nan's).
Sounds like homework so I'll just give a hint.
for angle = 0 : 360
x1 = ....
x2 = ....
x3 = .....
x4 = ....
x1 = ....
x2 = ....
x3 = .....
x4 = ....
line([x1,x2,x3,x4], [y1,y2,y3,y4]);
drawnow;
pause(.5); % Pause so we can see it.
end
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Animation에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!