 close all;
 y = load('temps');
 t = [1:13]';
%%-------------------- 'deg. 2' trig. pols.
 for i=1:2
       C(:,i) = cos(i*2*pi*t/13);
       S(:,i) = sin(i*2*pi*t/13);
%%   C(:,i) = t .^ (2*i-1);
%%   S(:,i) = t .^ (2*i);
 end
 F = [ones(13,1), C, S];
%-------------------- solve with normal equations
  a = (F'*F)\(F'*y);
%-------------------- solve with householder QR
% a = hoLS(F,y);
%-------------------- plotting
 plot(t,y,'o'); 
 hold
 z = F*a;
 plot(t,z,'r--')
