Power method Matlab

$\begingroup$

I am trying to find the largest eigenvalue and its corresponding eigenvector by the

Power method

.. I did this code and I just want to display the largest eigenvalue and its eigenvector after asking the user to enter an n * n matrix.. can someone help me to add the right statements? Here is my code..

function [ v d] = power_method( A )
disp ( ' Enter the matrix whose eigen value is to be found')
% Calling matrix A
A = input ( ' Enter matrix A : \n')
% check for matrix A
% it should be a square matrix
[na , ma ] = size (A);
if na ~= ma
disp('ERROR:Matrix A should be a square matrix')
return
end
%display of final result
fprintf (' The largest eigen value obtained is \n')
disp('and the corresponding eigen vector is ')
$\endgroup$ 5 Reset to default

Know someone who can answer? Share a link to this question via email, Twitter, or Facebook.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like