TP-traitement-audio-visuel/TP3_dams/moindres_carres.m

10 lines
203 B
Mathematica
Raw Normal View History

2023-06-22 18:47:16 +00:00
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