diff options
Diffstat (limited to '62/CH2/EX2.5/ex_2_5.sce')
-rwxr-xr-x | 62/CH2/EX2.5/ex_2_5.sce | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/62/CH2/EX2.5/ex_2_5.sce b/62/CH2/EX2.5/ex_2_5.sce new file mode 100755 index 000000000..3dedb04ec --- /dev/null +++ b/62/CH2/EX2.5/ex_2_5.sce @@ -0,0 +1,33 @@ +//Example 2.4:Convolution Integral
+clear;
+close;
+clc;
+t =-5:1/100:5;
+for i=1:length(t)
+ if t(i)<0 then
+ h(i)=0;
+ x(i)=exp(t(i));
+ else
+ h(i)=exp(-t(i));
+ x(i)=0;
+ end
+end
+y = convol(x,h)./100;
+figure
+a=gca();
+a.x_location="origin";
+plot2d(t,h)
+xtitle('Impulse Response','t','h(t)');
+a.thickness = 2;
+figure
+a=gca();
+plot2d(t,x)
+xtitle('Input Response','t','x(t)');
+a.thickness = 2;
+figure
+a=gca();
+t1=-10:1/100:10;
+a.y_location="origin";
+plot2d(t1,y)
+xtitle('Output Response','t','y(t)');
+a.thickness = 2;
|