www.gusucode.com > mbcguitools 工具箱 matlab 源码程序 > mbcguitools/@xregGui/@axisslider/setLimits.m

    function setLimits( h, mn, mx )
%SETLIMITS Set the min and max properties of the object
%
%  SETLIMITS(OBJ, MIN, MAX)
%

%  Copyright 2000-2010 The MathWorks, Inc. and Ford Global Technologies, Inc.

% Disable property listeners during operation
set(h.ASList, 'enabled', 'off');

set(h, 'Min', mn, 'Max', mx);
if h.Min>h.Max
    lims = [0 1];
else
    lims = [h.Min h.Max];
end
set(h.Axes, 'XLim', lims, 'YLim', lims);
if ~isnan(h.Value)
    h.doDrawMarker;
end

set(h.ASList, 'enabled', 'on');