how to plot repeating steps graph real time/animated
Mostrar comentarios más antiguos

the picture is sideways but
Is there a way to animate this sort of graph?
so far I have:
clc, clearvars
h = animatedline;
axis([0,5*pi,0.8,1])
x = linspace(0,5*pi,5000);
y = sin(x);
posY=y(y>0.8);
posX=x(y>0.8);
for k = 1:length(x)
addpoints(h,posX(k),posY(k));
% scatter(posX(k),posY(k));
plot (posX,posY,'.');
end
this is a partial plot of a sine wave but i would like to do a partial plot of a graph like the one I've drawn. Thank you in advance.
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Animation en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!