% program is improved 14.02.2011 by L.V. Zotov clear; fin=fopen('lambda319_phi36pc__all.dat','rt'); fgetl(fin); A=fscanf(fin,'%f',[2 inf]);% A - array of data fclose(fin); %determining the size of the signal l=size(A); N=l(2); %selecting the rows of the Array Date=A(1,1:N); X=A(2,1:N); dt=Date(2)-Date(1); %X=randn(1,N); plot(Date,X) m=mean(X); signal_centered=X-m; deg=2; p_coef=polyfit(Date,X,deg); model_poly = polyval(p_coef,Date); plot(Date,X,Date,model_poly)