data_num=100;
file_num=3;
X=zeros(data_num,1);
Y=zeros(data_num,1);
Z=zeros(data_num,1);
T=zeros(data_num,1);
X_mode=zeros(file_num,1);
Y_mode=zeros(file_num,1);
Z_mode=zeros(file_num,1);
fid=zeros(file_num,1);
for i=1:file_num
fid=fopen('point1_%d.txt','r',i);
for j=1:data_num
tline = fgetl(fid);
if (isempty(tline)==1)
break
elseif (tline==-1)
break
else
x_start=find(tline=='=');
x_end=find(tline=='[');
val_x= tline(x_start+1:x_end-1);
val_x=str2num(val_x);
tline = fgetl(fid);
y_start=find(tline=='=');
y_end=find(tline=='[');
val_y= tline(y_start+1:y_end-1);
val_y=str2num(val_y);
tline = fgetl(fid);
z_start=find(tline=='=');
z_end=find(tline=='[');
val_z= tline(z_start+1:z_end-1);
val_z=str2num(val_z);
tline = fgetl(fid);
h_start=find(tline=='>');
val_h= tline(h_start-14:h_start-13);
val_h=str2num(val_h);
m_start=find(tline=='>');
val_m= tline(m_start-11:m_start-10);
val_m=str2num(val_m);
s_start=find(tline=='>');
val_s= tline(s_start-8:s_start-7);
val_s=str2num(val_s);
val_t=val_h*3600+val_m*60+val_s;
X(k)=val_x;
Y(k)=val_y;
Z(k)=val_z;
T(k)=val_t;
end
X_mode(i)=mode(X);
Y_mode(i)=mode(Y);
Z_mode(i)=mode(Z);
end
end