function mat2dat(FileName) % mat2dat transfere les fichiers capté par control disk en fichier dat pour visualiser % avec graph ou exel. % On mets le fichier sans extension. Par exemple mat2dat('data'). % programmé par Imad AL-ROUH - GREEN - UHP. % 14/10/2003 sort=load(FileName); names=fieldnames(sort); c=names{1}; s=getfield(sort,c); [m,n]=size(s.Y); fid = fopen(sprintf('%s.dat',FileName),'W'); fprintf(fid,'%s', 't'); for k=1:n, f = getfield(s.Y(k),'Name'); I=find(f=='"'); sizeI=size(I); f=f(I(sizeI(2)-1)+1:I(sizeI(2))-1); fprintf(fid,'\t\t'); fprintf(fid,'%s', f); end for k=1:n, var(k,:) = getfield(s.Y(k),'Data'); end [m,n]=size(var); t=getfield(s.X,'Data'); for index=1:n, fprintf(fid,'\n'); fprintf(fid,'%e', t(index)); for jj=1:m, fprintf(fid,'\t\t'); fprintf(fid,'%e', double(var(jj,index))); end end fclose(fid);