looking to have 2 lines, same length, with the angle changing between them? Cant figure out how to animate this?

2 次查看(过去 30 天)
help

回答(1 个)

Image Analyst
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

类别

Help CenterFile Exchange 中查找有关 Animation 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by