%%
clear

t = (1:10)';
A0 = [ 0; 1 ];
s = 1;

X = [ ones(size(t)) t ];
Y0 = X*A0;

Ntestes = 1000;
for qT = 1:Ntestes
    Y = Y0 + s*randn(size(Y0));
    [ A(:,qT), sA, Q2(qT), NGL, VA, F(:,qT) ] = mmq_lin( X, Y, s );
end

% figure
% errorbar( t, Y, s*ones(size(Y)), 'or' )
iT = (1:Ntestes );
figure
subplot( 2,2,1 )
plot( iT, A(1,:), '.' )
subplot( 2,2,2 )
plot( iT, A(2,:), '.' )
subplot( 2,2,3 )
plot( iT, Q2(:), '.' )
subplot( 2,2,4 )
plot( iT, F(5,:), '.', iT, F(1,:), '.' )


