function r=range(x)
%RANGE Returns the range of data values.
%   R = RANGE(X)

% Copyright 2004-2010 RBemis The MathWorks, Inc. 

if nargin~=1 || nargout>1, error('USAGE: r=range(x)'), end

if nargout>0
  r=diff(limits(x));
else
  diff(limits(x))
end
