Question: problem of index

Deal all

I would like to approximate the largest eigenvalue of a given maxtrix and its corresponding eigenvector. 
I have a problem in step 7, how obtain the index where the maximum is located, then How I return at the end of while loop 
a table contains eigenvalues, eigenvectors and err 

PWM.mw

Thank you 

Please Wait...