aa=load('..\Données\Bangweulu.txt');
t=aa(:,1);
x=aa(:,2);
dx=aa(:,3);
errorbar(t,x,dx,'k','linewidth',2);
A=[0*t'+1;t';cos(2*pi*t)';sin(2*pi*t)';cos(4*pi*t)';sin(4*pi*t)'];
y=A'\x
mod1=A'*y;
err=repmat(dx,1,6)';
Ab=A./err;
xp=x./dx;
y=Ab'\xp
mod2=A'*y;
hold on
plot(t,mod1,'r',t,mod2,'b','linewidth',2)
hold off
