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/CH3/EX3.22/EX3_22.sce | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100755 2294/CH3/EX3.22/EX3_22.sce (limited to '2294/CH3/EX3.22/EX3_22.sce') diff --git a/2294/CH3/EX3.22/EX3_22.sce b/2294/CH3/EX3.22/EX3_22.sce new file mode 100755 index 000000000..cc82a830c --- /dev/null +++ b/2294/CH3/EX3.22/EX3_22.sce @@ -0,0 +1,33 @@ +//Example 3.22 +clear ; + close ; + clc ; + t = -5:1/100:5; + for i =1: length (t) + if t(i) <0 then + h(i)=0; + x(i)=0; + else + h(i)=1; + x(i)=1; + end + end + y = convol (x,h) ; + //figure + f=scf(0); + plot2d (t,h) + xtitle ( ' Input Re spons e ' , ' t ' , ' h ( t ) ' ); + xs2jpg(0, 'problem31-plot-a.jpg'); + //figure + f=scf(1); + plot2d (t,x) + xtitle ( ' Input Re spons e ' , ' t ' , ' x ( t ) ' ); + xs2jpg(0, 'problem31-plot-b.jpg'); + //figure + f=scf(2); + a= gca (); + t1 = -10:1/100:10; + plot2d (t1 ,y) + xtitle ( ' Output Re spons e ' , ' t ' , ' y ( t ) ' ); + xs2jpg(0, 'problem31-plot-c.jpg'); + -- cgit