summaryrefslogtreecommitdiff
path: root/692/CH2/EX2.22/P2_22.sce
blob: 035d20a811a8467fc32ed72c5499fd5eb1b19efc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
//EXAMPLE 2.22,impulse response of accumulator

clear;
clc;
d=[1];
t=-1:.01:1;
h=0;
clf();
figure(0);
a=gca();
a.x_location="origin";

for i=1:length(t)
    if t(i)<0 
      h=0;
    else
        h=d;
        plot2d3(i-101,h)
        plot(i-101,h,'.r') 
        xtitle('Impulse Response of accumulator','t','Y');
        a.children.children.thickness=1;
        a.children.children.foreground=2;
    end
end
disp(h,'The impulse response of Accumulator is =')