![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/175001/image.png)
Hi, i need to find out the eigenvalues of a 8000x8000 matrix system by eig() function of matlab?? may i know the normal simulation time of the eig() function of such a huge matrix in MATLAB?
5 次查看(过去 30 天)
显示 更早的评论
Hi, i need to find out the eigenvalues of a 8000x8000 matrix system by eig() function of matlab?? may i know the normal simulation time of the eig() function of such a huge matrix in MATLAB?
0 个评论
回答(2 个)
George
2016-9-6
It's going to depend on the matrix, correct?
Running a simulation on my machine (Surface Pro3) I was able to modify the example from the eig() documentation to use a 8000x8000 matrix. It calculated the eigenvalues in ~44sec.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/175001/image.png)
0 个评论
John D'Errico
2016-9-6
编辑:John D'Errico
2016-9-6
The normal time is 42. I'm not sure what the units are though. :)
How can we tell you the "normal time" to compute eigenvalues? It will depend on what computer you have. It will depend on the speed of that computer. It will depend on how much RAM you have. It will depend on the matrix. (If your matrix is diagonal, this will go pretty fast.)
If you really want to know the "normal" time for your computer, then time eig for a series of smaller nxn matrices, and extrapolate the time up to n=8000.
t = NaN(1,1800);
N = 100:100:1800;
for n = N
A = randn(n);
t(n) = timeit(@() eig(A));
end
loglog(N,t(N),'o')
grid on
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/175002/image.jpeg)
p = polyfit(log(N),log(t(N)),1)
p =
2.1406 -14.748
exp(polyval(p,log(8000)))
ans =
89.16
So, on MY computer, I'd expect it to take roughly 1.5 minutes, unless it starts to have memory problems.
0 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!