hb_findIdx.m 494 B

1234567891011121314151617181920
  1. function [idx,short] = hb_findIdx( range, fullData )
  2. % function idx = hb_findIdx( range, fullData )
  3. short=false;
  4. idx = max(find( fullData < range(1)))+1:max(find(fullData<range(2)));
  5. if length(idx)==0
  6. % idx
  7. idx = 1:max(find(fullData<range(2)));
  8. end
  9. if range(2) > fullData(end)
  10. short=1;
  11. % disp(['Requested range: .. ' num2str( range(2)) ]);
  12. % disp(['Actual range: .. ' num2str(fullData(end)) ]);
  13. % disp(['Short: ' num2str( short) ]);
  14. end
  15. return