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 --- 1034/CH1/EX1.9/example9.sce | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100755 1034/CH1/EX1.9/example9.sce (limited to '1034/CH1/EX1.9') diff --git a/1034/CH1/EX1.9/example9.sce b/1034/CH1/EX1.9/example9.sce new file mode 100755 index 000000000..19b95e712 --- /dev/null +++ b/1034/CH1/EX1.9/example9.sce @@ -0,0 +1,24 @@ +clear; +clc; +printf("\n Example 1.9"); +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; +c=1; +for i=1:p + for j=1:q + z(i,j)=x(i,j)+y(i,j);..........//summing two matrices + c=c+1;...........//step count + end +end +printf("\n Resultant matrix after addition ="); +disp(z);.............//displayin sum of two matrices. +printf("\n step count is=%d",(c-1)); -- cgit