diff options
author | priyanka | 2015-06-24 15:03:17 +0530 |
---|---|---|
committer | priyanka | 2015-06-24 15:03:17 +0530 |
commit | b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (patch) | |
tree | ab291cffc65280e58ac82470ba63fbcca7805165 /62/CH2/EX2.6/ex_2_6.sce | |
download | Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.tar.gz Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.tar.bz2 Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.zip |
initial commit / add all books
Diffstat (limited to '62/CH2/EX2.6/ex_2_6.sce')
-rwxr-xr-x | 62/CH2/EX2.6/ex_2_6.sce | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/62/CH2/EX2.6/ex_2_6.sce b/62/CH2/EX2.6/ex_2_6.sce new file mode 100755 index 000000000..9ff4644cd --- /dev/null +++ b/62/CH2/EX2.6/ex_2_6.sce @@ -0,0 +1,43 @@ +//Example 2.6: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)=0;
+ elseif t(i)<=2
+ h(i)=1;
+ x(i)=1;
+ elseif t(i)<=3
+ h(i)=0;
+ x(i)=1;
+ else
+ h(i)=0;
+ 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.children.children.thickness = 3;
+a.children.children.foreground= 2;
+figure
+a=gca();
+plot2d(t,x)
+xtitle('Input Response','t','x(t)');
+a.children.children.thickness = 3;
+a.children.children.foreground= 2;
+figure
+a=gca();
+t1=-10:1/100:10;
+a.y_location="origin";
+a.x_location="origin";
+plot2d(t1,y)
+xtitle('Output Response','t','y(t)');
+a.children.children.thickness = 3;
+a.children.children.foreground= 2;
\ No newline at end of file |