function [t,mx,my,data] = read_data(fname,n)

if (nargin > 1)
  fn = [fname,'.',num2str(n)];
else
  fn = fname;
end;
fid = fopen(fn);
[info,count] = fscanf(fid,'%g %d %d %d',4);
t = info(1);
mx = info(2);
my = info(3);
meqn = info(4);
meqn = meqn + (meqn == 0);
data = fscanf(fid,'%g',[meqn,inf]);
data = data';
status = fclose(fid);
