3-D line of best fit from origin to cloud of data points
24 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I'm trying to get a line of best fit for a 3-D set of data points. This line of fit should go from the origin to the "cloud" of points, and I'd like to know the equation for that fit. Any ideas?
Thanks
0 commentaires
Réponses (1)
Matt J
le 3 Déc 2019
Modifié(e) : Matt J
le 3 Déc 2019
The equation is t*u where u is 3D line direction vector obtained by,
[V,d]=eig(A.'*A,'vector');
[~,i]=max(d);
u=V(:,i);
and A is an Nx3 matrix whose rows are your cloud points.
6 commentaires
Matt J
le 13 Nov 2021
@Chang hsiung You're quite welcome. Please accept-click the answer if it helped you.
Voir également
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!