# What is the fastest way to compute the first eigenvector?

18 visualizzazioni (ultimi 30 giorni)
Shojiro SHIBAYAMA il 10 Giu 2019
Commentato: gonzalo Mier il 3 Apr 2020
I'd like to know a way to compute the first eigenvector (the eigenvector with the largest eigenvalue) of a matrix A. Now I am using eig function.
[V, D] = eig(A);
However, this computes all eigenvectors of A, resulting in slow computation.
Does anyone know if there is a fastest way to compute the eigenvector? Thank you in advance.
##### 0 CommentiMostra -2 commenti meno recentiNascondi -2 commenti meno recenti

Accedi per commentare.

### Risposta accettata

gonzalo Mier il 10 Giu 2019
##### 4 CommentiMostra 2 commenti meno recentiNascondi 2 commenti meno recenti
Shojiro SHIBAYAMA il 10 Feb 2020
Modificato: Shojiro SHIBAYAMA il 10 Feb 2020
Wow thank you for the fruitful reply. I also have saw the results:
>> A=randn(100, 10);
>> AtA = A'*A;
>> rank(AtA)
10
>> tic;for i = 1:1000; eig(AtA);end; toc;
Elapsed time is 0.000973 seconds.
>> tic;for i = 1:1000; eigs(AtA);end; toc;
Elapsed time is 0.247325 seconds.
I am going to replace eigs with eig.
gonzalo Mier il 3 Apr 2020
Really interesting! Thank you for contribute

Accedi per commentare.

### Categorie

Scopri di più su Logical in Help Center e File Exchange

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by