0001
0002
0003
0004
0005
0006 function [error,time,TimeUnit,mode,npx,npy,pxcmx,pxcmy]=read_imatext(fileinput);
0007 error=0;
0008 time=[];
0009 TimeUnit='s';
0010 mode='pairs';
0011 npx=[];
0012 npy=[];
0013 pxcmx=1;
0014 pxcmy=1;
0015 if exist(fileinput,'file')~=2, error=2, return;end;
0016 dotciv=textread(fileinput);
0017 sizdot=size(dotciv);
0018 if ~isequal(sizdot(1)-8,dotciv(1,1));
0019 error=1;
0020 end
0021 nbfield=sizdot(1)-8;
0022 npx=(dotciv(2,1));
0023 npy=(dotciv(2,2));
0024 pxcmx=(dotciv(6,1));
0025 pxcmy=(dotciv(6,2));
0026
0027 abs_time1=dotciv([9:nbfield+8],2);
0028 dtime=dotciv(5,1)*(dotciv([9:nbfield+8],[3:end-1])+1);
0029 timeshift=[abs_time1 dtime];
0030 time=cumsum(timeshift,2);