How to plot y(n) over the range of 0<n<50. the equation given is y(n) = 1.97y(n-1) - y(n-2)
5 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
mrbond99
el 16 de Sept. de 2017
Comentada: mrbond99
el 16 de Sept. de 2017
the conditions for y(0) =0 and y(1) =1. do i need to use while statement?
0 comentarios
Respuesta aceptada
Star Strider
el 16 de Sept. de 2017
Since the limits are stated, I would just use a for loop:
y(1) = 0;
y(2) = 1;
for n = 3:51
y(n) = 1.97*y(n-1) - y(n-2);
end
figure(1)
plot(0:50, y)
grid
2 comentarios
Más respuestas (1)
Ver también
Categorías
Más información sobre Annotations 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!