Filter löschen
Filter löschen

Speed up the pseudoinverse calculation

4 Ansichten (letzte 30 Tage)
Vincent
Vincent am 18 Jun. 2015
Kommentiert: Vincent am 20 Jun. 2015
Hi,
I am looking for a way to decrease the computational time for some lines called thousands of times. The idea is to improve the computational speed of the calculation of the pseudoinverse (Jplus in the code). Do you think there is a faster way than using the svd decomposition in Matalb ? If you think its fun to try alternatives, you can give a shot (Enclosed is a save of the workspace with two mex functions). Just unzip the folder and run the code below (the mex-files will only work with 64bit Win platform. Sorry for that!! :))
for k=1:1500
markk=mark(:,k);
M=MR(1:3,markk,k,s)'; M=M(:);
markk3D=[markk;markk;markk];
a=1;er=1;
while mean(abs(er))>0.005 && a<6
T=Tags3M(qk,TS);
T=T(markk3D);
er=T-M;
J=TagsJacobian3M(qk,TS);
J=J(markk3D,:);
[U,S,V] = svd(J,0); r = size(S,1); SMin = S(r,r);
Jplus=V/S*U';
qk = qk - Jplus*er;
a=a+1;
end
end
Thank you for your valuable help!! And excuse me in advance for the late replies cause tomorrow is midsummer here in Sweden (working holiday)!!

Antworten (1)

Eric Lin
Eric Lin am 19 Jun. 2015
Depending on the dimensions of your matrices, applying the "0" or 'econ' argument to svd may speed up your calculation. SVD Documentation
This File Exchange submission claims to give a faster SVD calculation than the MATLAB implementation: Fast SVD
  1 Kommentar
Vincent
Vincent am 20 Jun. 2015
Thank you Eric. The eco calculation of the SVD is already included (see the code above). Thank you anyway for your time.

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Linear Algebra finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by