% 
%   Aufruf:
%     >> t = [0 2 4 6 8 10];
%     >> phi = [ 0.01 0.81 1.19 1.21 0.79 0.02];
%     >> [a,w0,phi0] = fit2( t, phi )
% 
function [a,w0,phi0] = fit2( t, phi )

  grad = 2;
  p = polyfit( t, phi, grad );
  
  % phi = a/2 * t.^2 + w0*t + phi0 
  a    = 2*p(1);
  w0   = p(2); 
  phi0 = p(3); 
  
  pf = polyval( p, t );
  plot( t, pf, 'b-', t, phi, 'sr' );

end
