summaryrefslogtreecommitdiff
path: root/1332/CH11/EX11.6/11_6.sce
diff options
context:
space:
mode:
authorpriyanka2015-06-24 15:03:17 +0530
committerpriyanka2015-06-24 15:03:17 +0530
commitb1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (patch)
treeab291cffc65280e58ac82470ba63fbcca7805165 /1332/CH11/EX11.6/11_6.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 '1332/CH11/EX11.6/11_6.sce')
-rwxr-xr-x1332/CH11/EX11.6/11_6.sce26
1 files changed, 26 insertions, 0 deletions
diff --git a/1332/CH11/EX11.6/11_6.sce b/1332/CH11/EX11.6/11_6.sce
new file mode 100755
index 000000000..1ead55877
--- /dev/null
+++ b/1332/CH11/EX11.6/11_6.sce
@@ -0,0 +1,26 @@
+//Example 11.6
+//Rayleigh Quotient
+//Page no. 348
+clc;close;clear;
+
+A=[10,7,8,7;7,5,6,5;8,6,10,9;7,5,9,10];
+q0=[1;1;1;1];
+for i=0:4
+ X=(A^i)*q0;
+ l=(X'*A*X)/(X'*X)
+ printf('\nLambda(%i) = %f\n',i+1,l)
+end
+printf('\n\nDominant Eigenvalue = %f\n\n\n',l)
+
+e=0.001;
+for i=1:5
+ q1=A*q0;
+ a=max(q1)
+ for j=1:4
+ q2(j)=q1(j)/a;
+ end
+
+ q1=q2;
+ q0=q1;
+end
+disp(q2,'Corresponding Eigenvector = ') \ No newline at end of file