range2.m 523 B

123456789101112131415161718
  1. % [MIN, MAX] = range2(MTX)
  2. %
  3. % Compute minimum and maximum values of MTX, returning them as a 2-vector.
  4. % Eero Simoncelli, 3/97.
  5. function [mn, mx] = range2(mtx)
  6. %% NOTE: THIS CODE IS NOT ACTUALLY USED! (MEX FILE IS CALLED INSTEAD)
  7. fprintf(1,'WARNING: You should compile the MEX version of "range2.c",\n found in the MEX subdirectory of matlabPyrTools, and put it in your matlab path. It is MUCH faster.\n');
  8. if (~isreal(mtx))
  9. error('MTX must be real-valued');
  10. end
  11. mn = min(min(mtx));
  12. mx = max(max(mtx));