summaryrefslogtreecommitdiff
path: root/1592/CH7/EX7.25/Example_7_25.sce
blob: aacc9cb9ce00e32ffc604d28b352d6266fa3a9b4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
//Scilab Code for Example 7.25 of Signals and systems by
//P.Ramakrishna Rao
//Plotting the impulse and step responses
clc;
clear;
syms z a n;
Y1=(2*z/(z-a));
disp(Y1,'Z Transform Of differential Equation is:')
y12=2*a^n;
disp(y12,'The Unit Sample Response of the System is:');
y2=2*(a^n-1)/(a-1);
disp(y2,'The Step Response of the System is:');
q=1;
a=0.5;
for k=0:0.1:5;
y2(q)=2*((a^k-1)/(a-1));
q=q+1;
end
k=0:0.1:5;
plot(k,y2);