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

17 lines
268 B
Matlab

function X = moindres_carres_ponderes(D_app, probas)
x = D_app(1,:)';
y = D_app(2,:)';
A = [
probas' .* [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