17 lines
268 B
Matlab
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
|
|
|