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

17 lines
268 B
Mathematica
Raw Normal View History

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