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.)
Afficher commentaires plus anciens
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
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur 2-D and 3-D Plots dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!