function x = trimnumber( lo, x, hi )
%x = trimnumber( lo, x, hi )
%   Force every element of x to lie within lo..hi.  x may be a numerical
%   array of any size and shape.

    x = max( lo, min( hi, x ) );
end
