summaryrefslogtreecommitdiff
path: root/191/CH4/EX4.1/Example4_1.sce
diff options
context:
space:
mode:
Diffstat (limited to '191/CH4/EX4.1/Example4_1.sce')
-rwxr-xr-x191/CH4/EX4.1/Example4_1.sce17
1 files changed, 17 insertions, 0 deletions
diff --git a/191/CH4/EX4.1/Example4_1.sce b/191/CH4/EX4.1/Example4_1.sce
new file mode 100755
index 000000000..79593dae9
--- /dev/null
+++ b/191/CH4/EX4.1/Example4_1.sce
@@ -0,0 +1,17 @@
+//The Power Method of finding largest Eigen value of given matrix
+clear;
+clc;
+close();
+A=[3 0 1;2 2 2;4 2 5]; //Given Matrix
+u0=[1 1 1]'; //Intial vector
+v=A*u0;
+a=max(u0);
+while abs(max(v)-a)>0.05 //for accuracy
+ a=max(v);
+ u0=v/max(v);
+ v=A*u0;
+end
+format('v',4);
+disp(max(v),'Eigen value :')
+format('v',5);
+disp(u0,'Eigen vector :') \ No newline at end of file