computation time-eigen vectors multiplication
显示 更早的评论
Hello,
I've written a simple for loop to compute the Q matrix shown in the formula attached. For every k(from k=2 to k=N), we multiply the eigen vector z_k with its transpose z_k^T and divide the result by the correspding eigen value mu_k. Here, N is the number of nodes in the network and q is a NxN symmetric matrix.
[x,y] =size(q);
N =x;
[V,W] =eig(q);
Q =zeros(N);
for i=2:1:N;Q=Q+(((V(:,i))*(V(:,i).'))/(W(i,i)));end
It works fine for small networks(takes roughly 20 secs for N=1200). However, I intend on using it for networks with as many as N=12000 nodes. This seems to take forever.
I'm using R2018a. My license does not include the parallel computing toolbox so I cannot use the parfor function. Is there any other way I can reduce the computation time? Perhaps to a few minutes?
Thank you
Kind Regards,
Sharadhi
2 个评论
John D'Errico
2018-9-24
You are computing a rank N-1 variation of a quasi pseudo-inverse? Not sure why. And why assume the first eigenvalue is always a specific one? That is a REALLY BAD idea, because eig does not insure the order of the eigenvalues.
sharadhi
2018-9-24
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Operating on Diagonal Matrices 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!