내 질문은 꽤 표준이지만 그 해결책을 찾을 수 없습니다.플롯 3D 라인, matlab
나는 점 = [x, y, z]를 가지며 가장 잘 맞는 선을 그려보고 싶다.
나는
% LS3DLINE.M Least-squares line in 3 dimensions.
%
% Version 1.0
% Last amended I M Smith 27 May 2002.
% Created I M Smith 08 Mar 2002
% ---------------------------------------------------------------------
% Input
% X Array [x y z] where x = vector of x-coordinates,
% y = vector of y-coordinates and z = vector of
% z-coordinates.
% Dimension: m x 3.
%
% Output
% x0 Centroid of the data = point on the best-fit line.
% Dimension: 3 x 1.
%
% a Direction cosines of the best-fit line.
% Dimension: 3 x 1.
%
% <Optional...
% d Residuals.
% Dimension: m x 1.
%
% normd Norm of residual errors.
% Dimension: 1 x 1.
% ...>
%
% [x0, a <, d, normd >] = ls3dline(X)
나는이 아래에 주어진 기능을 사용하여 (그리고 고맙습니다 스미스)입니다. DIST 최소이고 따라서 방정식
points*a+dist=0
수있다. 기원과의 거리.
내 질문은 어떻게 최고의 filt 선을 3D로 플롯하는 것입니다.