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

17 lines
240 B
Mathematica
Raw Normal View History

2023-06-22 18:47:16 +00:00
function X = moindres_carres(D_app)
x = D_app(1,:)';
y = D_app(2,:)';
A = [
[x.^2, x.*y, y.^2, x, y, ones(length(x), 1)] ;
[1, 0, 1, 0, 0, 0]
];
O = [ zeros(length(x), 1) ; 1 ];
X = A \ O;
end