TP-traitement-audio-visuel/TP3_dams/moindres_carres.m
2023-06-22 20:47:16 +02:00

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