10 lines
203 B
Matlab
10 lines
203 B
Matlab
function X = moindres_carres(D_app)
|
|
n_app = length(D_app);
|
|
x = D_app(1,:)';
|
|
y = D_app(2,:)';
|
|
|
|
A = [x.^2 x.*y y.^2 x y ones(n_app,1) ; 1 0 1 0 0 0];
|
|
X = A \ [zeros(n_app,1) ; 1];
|
|
end
|
|
|