plot discrete time function x(n)=y(n-2). it shows error (Attempted to access y(-1); index must be a positive integer or logical.)
Mostrar comentarios más antiguos
clc;
clear all;
x=-5:1:5;
for n=1:11
if x(n)>=-3&&x(n)<=3
y(n-2)=2*x(n);
else
y(n-2)=0;
end
end
stem(x,y)
xlabel('n')% x-axis label
ylabel('x(n)')% y-axis label
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre 2-D and 3-D Plots en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!