filelist = dirs('binfiles/pcode/*.bin', 'fullpath', 1);

for filei = 1:length(filelist)
   fname = filelist(filei).name;
   bdata = read_bin(fname);

    
   if (isempty(bdata))
      fprintf('no data read from %s\n', fname)
      fprintf('------------------------------------------------\n')
   else
      if (min(diff(bdata(1,:))) <= 0)
         fname
         badi = find(diff(bdata(1,:))<=0)
         ii = [max(1, badi(1)-1) : min(length(bdata(1,:)), badi(end) + 1)];
         fprintf('%4.7f    %7f     %4.7f    %4.7f\n', bdata(:,ii))
      fprintf('------------------------------------------------\n')
      end
      
   end
end
