summaryrefslogtreecommitdiff
path: root/2279/CH1/EX1.5/Ex1_5.sce
blob: 4f3bb9b34bdf70b22fb0ad11ca412513b87a83d4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
clear
clf
clc
n=-20:1:20;
for i=1:length(n)
    if n(i)>=0 then
        x(i)=2;
    else
        x(i)=0;
    end
end
plot(n,x,".");
xtitle("x(n)=0 for n<0 and x(n)=2 for n>=0","number of samples","amplitude");
xgrid(5)