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.

 採用された回答

gonzalo Mier
gonzalo Mier 2019 年 6 月 10 日

0 投票

Read about eigs

4 件のコメント

Shojiro SHIBAYAMA
Shojiro SHIBAYAMA 2019 年 6 月 10 日
Hi,
It looks suitable for my task. Thank you for the quick reply.
Meiling HU
Meiling HU 2020 年 2 月 9 日
It seems that eigs takes longer time to compute than eig. For 100 iterations of 25*25 matrix, eigs takes 1 sec while eig only takes 0.06.
Shojiro SHIBAYAMA
Shojiro SHIBAYAMA 2020 年 2 月 10 日
編集済み: Shojiro SHIBAYAMA 2020 年 2 月 10 日
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
gonzalo Mier 2020 年 4 月 3 日
Really interesting! Thank you for contribute

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File Exchange で MATLAB についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by