From b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b Mon Sep 17 00:00:00 2001 From: priyanka Date: Wed, 24 Jun 2015 15:03:17 +0530 Subject: initial commit / add all books --- 2294/CH4/EX4.4.2/EX4_4_2.sce | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100755 2294/CH4/EX4.4.2/EX4_4_2.sce (limited to '2294/CH4/EX4.4.2/EX4_4_2.sce') diff --git a/2294/CH4/EX4.4.2/EX4_4_2.sce b/2294/CH4/EX4.4.2/EX4_4_2.sce new file mode 100755 index 000000000..245736d8a --- /dev/null +++ b/2294/CH4/EX4.4.2/EX4_4_2.sce @@ -0,0 +1,25 @@ +//Example 4.4 +//Find the step response of the following impulse response. +clc; +t=-1:.01:1; +for i=1:length(t) + if t(i)==0 then + del1(i)=1;del2(i)=0; + elseif t(i)==1 then + del1(i)=0;del2(i)=1; + else + del1(i)=0;del2(i)=0; +end +h(i)=del1(i)-del2(i); +if t(i)<0 then + u(i)=0; +else + u(i)=1; +end +end +s=convol(h,u); +t1=-10:.05:10; +f=scf(0); +plot(t1,s,'red'); +xtitle('s[t]'); +xs2jpg(0, 'EX4_4_2-plot-a.jpg'); -- cgit