summaryrefslogtreecommitdiff
path: root/413/CH6/EX6.10/Example_6_11.sce
diff options
context:
space:
mode:
Diffstat (limited to '413/CH6/EX6.10/Example_6_11.sce')
-rw-r--r--413/CH6/EX6.10/Example_6_11.sce23
1 files changed, 23 insertions, 0 deletions
diff --git a/413/CH6/EX6.10/Example_6_11.sce b/413/CH6/EX6.10/Example_6_11.sce
new file mode 100644
index 000000000..e8f7ba367
--- /dev/null
+++ b/413/CH6/EX6.10/Example_6_11.sce
@@ -0,0 +1,23 @@
+A=[3,-1,0;-2,4,-3;0,-1,1;]
+disp(A)
+printf('Eigen values are:')
+disp(spec(A))
+printf('Display of Power Method:')
+U=[1,1,1]'
+for i=1:14
+ B=A*U
+ a=abs(B(1,1))
+ b=abs(B(2,1))
+ c=abs(B(3,1))
+ if ((a>b)&(a>c)) then
+ T= (B(1,1))
+ elseif ((b>a)&(b>c)) then
+ T=(B(2,1))
+ else T=(B(3,1))
+ end
+ printf('After %d iteration eigenvalue is ',i)
+ disp(T)
+ printf(' corresponding eigenvector is ')
+ U=B/T
+ disp(U)
+end \ No newline at end of file