Plot one by one....for loop

1 visualización (últimos 30 días)
Ale
Ale el 25 de Nov. de 2016
Respondida: KSSV el 25 de Nov. de 2016
Hi, I have this:
plot(time,n)
and I want each data to be plotted one by one, i tried with a this
for p=1:1:24
plot(time,n)
hold on
plot(time, n(p))
end
but I really don't have idea how to do it...
thanks,

Respuesta aceptada

KSSV
KSSV el 25 de Nov. de 2016
clc; clear all ;
x = 1:100 ;
y = rand(1,100) ;
for i = 1:100
plot(x(1:i),y(1:i))
axis([0 100 min(y) max(y)])
drawnow
end
Or
comet(x,y)

Más respuestas (0)

Categorías

Más información sobre Loops and Conditional Statements en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by