matlab LSQ error calculation computation time
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hi everybody,
I am trying to calculate a simple least squares solution and its corresponding error with the function below. When calculating the error the script slows down significantly. In fact a run with an active profiler shows that 99% of computation time is spent in the line
err=psi'*(I-H*t)*psi.
Can anybody explain why this line is so expensive or give an solution that is faster?
%H: observation matrix,
%I: identiy matrix,
%psi: measurement vector,
%PCO: parameter estimate,
%err: error of the estimate
function [PCO,err]=calcPC_LSQ(H,I,psi)
t=(H'*H)\H';
PCO=t*psi;
err=psi'*(I-H*t)*psi;
end
0 commentaires
Réponses (0)
Voir également
Catégories
En savoir plus sur Logical dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!