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 /1034/CH1/EX1.11 | |
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 '1034/CH1/EX1.11')
-rwxr-xr-x | 1034/CH1/EX1.11/Example11.sce | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/1034/CH1/EX1.11/Example11.sce b/1034/CH1/EX1.11/Example11.sce new file mode 100755 index 000000000..6a8aee12d --- /dev/null +++ b/1034/CH1/EX1.11/Example11.sce @@ -0,0 +1,22 @@ +clear;
+clc;
+printf("\n Example 1.11");
+// Matrix addition.
+a=[1 2 3;4 5 6];
+b=[7 8 9;10 11 12];
+x=matrix(a,3,2);........//no. of rows=3,no. of col. =2.
+y=matrix(b,3,2);........//no, of rows=3,no. of col.=2.
+printf("matrix x=");
+disp(x);
+printf("matrix y=");
+disp(y);
+[p,q]=size(x);
+i=1;
+j=1;
+for i=1:p
+ for j=1:q
+ z(i,j)=x(i,j)+y(i,j);..........//summing two matrices
+ end
+end
+printf("\n Resultant matrix after addition =");
+disp(z);.............//displayin sum of two matrices.
\ No newline at end of file |