Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

I am running a matlab code for computing the Drazin inverse of the matrix $A$.

Initial value of the iteration method is $X_0 = \beta A^{k}$, where $k = index (A)$(For $A\in \mathbb{C}^{n\times n}$, the smallest nonnegative integer $k$ such that $rank(A^{k+1}) = rank(A^k)$ is called the index of $A$). .

Parameter $\beta$ satisfies: $0<\beta < \frac{2}{\lambda_{max}(A^{k+1})}$.

I want to test the method for the randomly generated matrices so I need a matlab code to determine the maximum eigen value of the matrix $A^k$ so that I may easily choose the value of $\beta$.

Could anybody help me with this. Thanks

share|improve this question
    
You may use $\mathtt{eig}(\cdot)$ and then call $\mathtt{max}(\cdot)$? –  Lord Soth Apr 24 '13 at 18:54
1  
Depending on your size of matrix, using eigs to find only the largest eigenvalue with power-method may be faster. –  Memming Apr 24 '13 at 18:57
    
@Memming I am using $1000 \times 1000$ matrix. –  srijan Apr 24 '13 at 18:59
add comment

1 Answer 1

up vote 2 down vote accepted

Are you looking for the largest eigenvalue or the eigenvalue with the largest magnitude? For magnitude,

a=rand(1000);
max(abs(eig(a)))

is much slower especially if you want to repeat it multiple times because it will compute all of the eigenvalues and then pick the max. You might want to use

a=rand(1000);
eigs(a,1)

which will compute and return only the largest magnitude eigenvalue.

share|improve this answer
    
Thank you very much. It helped me. :) –  srijan Apr 24 '13 at 21:52
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.