%

clear;
close all;

fid=fopen('olrf30-100_as.80.dat','r');
siz=24*15*3538;
v=fread(fid,siz,'float');
fclose(fid);
olr=reshape(v,360,3538);
clear v;

% calcul de la matrice de covariance
vaudou=zeros(360,360);
for a=1:360;
    for b=1:360;
      clear e d covaria;
      e=olr(b,:);
      d=olr(a,:);
      covaria=cov(e,d);
      vaudou(a,b)=covaria(2,1);
    end;
end;

% on diagonalise la matrice de covariance
[C,L]=eig(vaudou);

delete('eof_30100_ircaam_as.mat');
save('eof_30100_ircaam_as.mat','C','L','olr')
