function data=readata(dims,filestr);
fstring = '';
for i = 1:dims-1
   fstring=[fstring '%f '];
end
fstring = [fstring '%f'];
fid = fopen(filestr,'r'); 
if (fid > 0)
  AA = fscanf(fid,fstring);
  % dims = 3;
	fclose(fid);
else
	disp('file can not open!');
end
[RAA, CAA] = size(AA);
data = zeros(RAA/dims,dims);
for i = 1:RAA
      j = ceil(i/dims);
      data(j,i-(j-1)*dims)=AA(i,1);
end
