Matrix inside for loop not updating

Hi, I am trying to plot a function on a graph while in a loop but while my increment value is updating, my Y value data is not. My code is below, Thank you for Looking.
for t =1:1:200
g1(t)=3*cos(2*pi*450*t-141);
plot(t,g1(t),'.')
drawnow
end

 Respuesta aceptada

Torsten
Torsten el 2 de Sept. de 2022
hold on
for t =1:1:200
g1(t)=3*cos(2*pi*450*t-141);
plot(t,g1(t),'.')
drawnow
end

Más respuestas (0)

Categorías

Más información sobre Loops and Conditional Statements en Centro de ayuda y File Exchange.

Productos

Etiquetas

Preguntada:

el 2 de Sept. de 2022

Comentada:

el 2 de Sept. de 2022

Community Treasure Hunt

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

Start Hunting!

Translated by