Animate a rectangle, for loop used
Mostra commenti meno recenti
Hello! The code below takes a large matrix (x) and shows 'o' moving up and down on a plot. I would like to change the 'o' into a rectangle moving in the same way, hanging by a string. How would I do this?
for i = 1:125
plot(x(i),'o')
axis([0 5 -5 5])
y(i) = getframe
end
movie(y,25,25)
1 Commento
Anastasia Zistatsis
il 17 Feb 2021
Risposta accettata
Più risposte (0)
Categorie
Scopri di più su Animation in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
