eval(['load ',filen,'.plt'])
eval(['a=',filen,';'])
tem=a(1,3);
nfound = 1;
n = 1;
while nfound;
  n=n+1;
  if tem~=a(n,3); nfound=0; end;
end;
n = n-1;
tem=a(1,2);
m = 1;
nfound = 1;
while nfound;
  m=m+1;
  if tem~=a(m,2); nfound=0; end;
end;
m = m-1;

[row,col]=size(a);
nc = row/n;
ny = n/m;
p=m*ny;
for i=1:nc;
  c = zeros(m,ny);
  x = c;
  x(:) = a((i-1)*p+1:i*p,1);
  c(:) = a((i-1)*p+1:i*p,4);
  eval(['c',int2str(i),'=c;'])
  str='plot(';
  for j=1:ny;
    l  = int2str(j);
    str=[str,'x(:,',l,'),c(:,',l,'),'];
  end;
  str=[str(1:length(str)-1),'),grid,pause']; 
  eval(str)
end;

for i=1:nc;
  h = zeros(m,ny);
  x = h;
  x(:) = a((i-1)*p+1:i*p,1);
  h(:) = a((i-1)*p+1:i*p,5);
  eval(['h',int2str(i),'=h;'])
  str='plot(';
  for j=1:ny;
    l  = int2str(j);
    str=[str,'x(:,',l,'),h(:,',l,'),'];
  end;
  str=[str(1:length(str)-1),'),grid,pause']; 
  eval(str)
end;

for i=1:nc;
  k = zeros(m,ny);
  x = k;
  x(:) = a((i-1)*p+1:i*p,1);
  k(:) = a((i-1)*p+1:i*p,6);
  eval(['k',int2str(i),'=k;'])
  str='plot(';
  for j=1:ny;
    l  = int2str(j);
    str=[str,'x(:,',l,'),k(:,',l,'),'];
  end;
  str=[str(1:length(str)-1),'),grid,pause']; 
  eval(str)
end;
