 function  y = clip( x, lo, hi )
 % CLIP ---  threshold large and small elements in matrix x
 [M,N] = size(x);
 for m = 1:M
   for n = 1:N
     if x(m,n) > hi
        x(m,n) = hi;
     elseif x(m,n) < lo
        x(m,n) = lo;
  
     end
   end
 end
 y=x;
 end
