posrect.m 162 B

123456789101112
  1. function m = posrect(m)
  2. % function m = posrect(m)
  3. %
  4. % <m> is a matrix
  5. %
  6. % positively-rectify <m>.
  7. %
  8. % example:
  9. % isequal(posrect([2 3 -4]),[2 3 0])
  10. m(m<0) = 0;