summaryrefslogtreecommitdiff
path: root/260/CH5/EX5.6/5_6.sce
diff options
context:
space:
mode:
Diffstat (limited to '260/CH5/EX5.6/5_6.sce')
-rw-r--r--260/CH5/EX5.6/5_6.sce21
1 files changed, 21 insertions, 0 deletions
diff --git a/260/CH5/EX5.6/5_6.sce b/260/CH5/EX5.6/5_6.sce
new file mode 100644
index 000000000..8d2b91677
--- /dev/null
+++ b/260/CH5/EX5.6/5_6.sce
@@ -0,0 +1,21 @@
+//Eg-5.6
+//pg-225
+
+clear
+clc
+
+A=[1 2 4;3 1 2;4 2 5];
+ z=[1;1;1];
+for i=1:7
+ printf('iteration number=%f\n',i);
+ a=A*z;
+ b=(sum(a.^2))^.5;
+ printf('dominant eigen value=%f\n',b);
+ z=a/b;
+ printf('z=%f\n',z);
+end
+
+disp("from iterations dominant eigen value converged to ")
+disp(b)
+disp("after 7 iterations")
+disp("its value is positive from equation 30"); \ No newline at end of file