summaryrefslogtreecommitdiff
path: root/692/CH2/EX2.29
diff options
context:
space:
mode:
authorpriyanka2015-06-24 15:03:17 +0530
committerpriyanka2015-06-24 15:03:17 +0530
commitb1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (patch)
treeab291cffc65280e58ac82470ba63fbcca7805165 /692/CH2/EX2.29
downloadScilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.tar.gz
Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.tar.bz2
Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.zip
initial commit / add all books
Diffstat (limited to '692/CH2/EX2.29')
-rwxr-xr-x692/CH2/EX2.29/P2_29.sce24
1 files changed, 24 insertions, 0 deletions
diff --git a/692/CH2/EX2.29/P2_29.sce b/692/CH2/EX2.29/P2_29.sce
new file mode 100755
index 000000000..fc59af2a4
--- /dev/null
+++ b/692/CH2/EX2.29/P2_29.sce
@@ -0,0 +1,24 @@
+//Example 2.29,Convolution using Tabular method.
+clear;
+clc;
+x=[-2 0 1 -1 3];
+h=[1 2 0 -1];
+q=length(x);
+w=length(h);
+z=q+w-1;
+y0=0;
+for i=1:z;
+ y(i)=0;
+ for k=1:i;
+ if k>q
+ x(k)=0;
+ else
+ if (i-k+1)>w
+ h(i-k+1)=0;
+ else
+ y(i)= y(i) + x(k)*h(i-k+1);
+ end
+ end
+ end
+end
+disp(y','The Convolution of the two sequences is =')