summaryrefslogtreecommitdiff
path: root/1670/CH4/EX4.13/4_13.sce
diff options
context:
space:
mode:
authorpriyanka2015-06-24 15:03:17 +0530
committerpriyanka2015-06-24 15:03:17 +0530
commitb1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (patch)
treeab291cffc65280e58ac82470ba63fbcca7805165 /1670/CH4/EX4.13/4_13.sce
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 '1670/CH4/EX4.13/4_13.sce')
-rwxr-xr-x1670/CH4/EX4.13/4_13.sce23
1 files changed, 23 insertions, 0 deletions
diff --git a/1670/CH4/EX4.13/4_13.sce b/1670/CH4/EX4.13/4_13.sce
new file mode 100755
index 000000000..4d4cb3c6b
--- /dev/null
+++ b/1670/CH4/EX4.13/4_13.sce
@@ -0,0 +1,23 @@
+//Example 4.13
+//House Holder Transformation
+//Page no. 113
+clc;clear;close;
+
+A=[3,2,1;2,3,2;1,2,3]
+disp(A,'A=')
+k=0;
+for j=2:3
+ k=k+A(j,1)^2;
+end
+a=A(2,1)*abs(1/A(2,1))*sqrt(k);
+disp(a,'alpha=')
+U=[0;a+A(2,1);A(3,1)];
+disp(U,'U=')
+U1=U'*U;
+disp(U1,'UT*U=')
+U2=U*U';
+disp(U2,'U*UT=')
+P=eye(3,3)-(2*U2)/U1;
+disp(P,'P=');
+B=P*A*P;
+disp(B,'B='); \ No newline at end of file