summaryrefslogtreecommitdiff
path: root/1332/CH9/EX9.4
diff options
context:
space:
mode:
authorpriyanka2015-06-24 15:03:17 +0530
committerpriyanka2015-06-24 15:03:17 +0530
commitb1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (patch)
treeab291cffc65280e58ac82470ba63fbcca7805165 /1332/CH9/EX9.4
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 '1332/CH9/EX9.4')
-rwxr-xr-x1332/CH9/EX9.4/9_4.pdfbin0 -> 6501 bytes
-rwxr-xr-x1332/CH9/EX9.4/9_4.sce34
2 files changed, 34 insertions, 0 deletions
diff --git a/1332/CH9/EX9.4/9_4.pdf b/1332/CH9/EX9.4/9_4.pdf
new file mode 100755
index 000000000..6996647bf
--- /dev/null
+++ b/1332/CH9/EX9.4/9_4.pdf
Binary files differ
diff --git a/1332/CH9/EX9.4/9_4.sce b/1332/CH9/EX9.4/9_4.sce
new file mode 100755
index 000000000..624b0e36e
--- /dev/null
+++ b/1332/CH9/EX9.4/9_4.sce
@@ -0,0 +1,34 @@
+//Example 9.4
+//QR Decomposition
+//Page no. 296
+clc;clear;close;
+
+A=[2,1,1;1,3,1;1,1,4];
+B=A*A';
+disp(B,'AT*A=')
+//cholesky factorization to find R
+R(2,1)=0;R(3,1)=0;R(3,2)=0;
+for i=1:3
+ for j=1:3
+ if(i==j)
+ k=0;
+ for m=1:i-1
+ k=k+R(m,i)^2;
+ end
+ R(i,j)=sqrt(B(i,j)-k)
+ end
+ if(j>i)
+ k=0;
+ for m=1:i-1
+ k=k+R(m,j)*R(m,i);
+ end
+ R(i,j)=(B(i,j)-k)/R(i,i)
+ end
+ end
+end
+//cholesky factorization end
+disp(R,'Upper Triangular Matrix (R)=')
+R_1=inv(R);
+disp(R_1,'Inverse of R')
+Q=A*R_1;
+disp(Q,'Orthogonal Matrix Q=') \ No newline at end of file