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.)
이전 댓글 표시
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
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!