looking to have 2 lines, same length, with the angle changing between them? Cant figure out how to animate this?
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
help
0 comentarios
Respuestas (1)
Image Analyst
el 25 de Nov. de 2014
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 comentarios
Ver también
Categorías
Más información sobre Animation en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!