summaryrefslogtreecommitdiff
path: root/1332/CH9/EX9.7
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.7
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.7')
-rwxr-xr-x1332/CH9/EX9.7/9_7.pdfbin0 -> 7638 bytes
-rwxr-xr-x1332/CH9/EX9.7/9_7.sce47
2 files changed, 47 insertions, 0 deletions
diff --git a/1332/CH9/EX9.7/9_7.pdf b/1332/CH9/EX9.7/9_7.pdf
new file mode 100755
index 000000000..b181eceb4
--- /dev/null
+++ b/1332/CH9/EX9.7/9_7.pdf
Binary files differ
diff --git a/1332/CH9/EX9.7/9_7.sce b/1332/CH9/EX9.7/9_7.sce
new file mode 100755
index 000000000..cf497efe8
--- /dev/null
+++ b/1332/CH9/EX9.7/9_7.sce
@@ -0,0 +1,47 @@
+//Example 9.7
+//Givens QR Method
+//Page no. 303
+clc;clear;close;
+
+A=[4,2,1;2,5,-2;1,-2,7]
+deff('y=c(i,j)','y=A(j,j)/sqrt((A(i,j)^2+A(j,j)^2))')
+deff('y=s(i,j)','y=A(i,j)/sqrt((A(i,j)^2+A(j,j)^2))')
+disp(A,'A=')
+R=A;Q=eye(3,3);
+m=1;
+for j=1:2
+ for i=j+1:3
+ for k=1:3 //C matrix evaluation
+ for l=1:3
+ if(k==l)
+ if(k==i | k==j)
+ C(k,l)=c(i,j)
+ else
+ C(k,l)=1
+ end
+ end
+ if(k>l)
+ if(k==i & l==j)
+ C(k,l)=-1*s(i,j)
+ else
+ C(k,l)=0
+ end
+ end
+ if(k<l)
+ if(k==j & l==i)
+ C(k,l)=s(i,j)
+ else
+ C(k,l)=0
+ end
+ end
+ end
+ end
+ printf('\n\n Iteration %i',m)
+ m=m+1
+ disp(C,'C=');
+ R=C*R;
+ Q=Q*C';
+ disp(Q,'Q=',R,'R=')
+ end
+end
+disp(Q*R,'Q*R=A=') //verification \ No newline at end of file