www.gusucode.com > mbcview 工具箱matlab源码程序 > mbcview/@cgtradeoffgui/@tradeoffGraphView/pUpdateYLims.m

    function pUpdateYLims(obj)
%PUPDATEYLIMS Update YLimits
%
%  PUPDATEYLIMS(OBJ) updates the YLimits data in the DataModel.

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


dm = obj.hDataModel;
if obj.ShowCommonYaxis ...
        && ~isempty(dm.ModelValues);
    nOutputs = getRowCount(dm);
    dm.YLimits = zeros(nOutputs, 2);
    for n = 1:nOutputs
        isInput = ~dm.IsBlank(n,:);
        if obj.ShowErrorLines && ~any(cellfun('isempty', dm.LowerModelPEBound(n, isInput)));
            % Find limits from the error line data
            data = [dm.LowerModelPEBound{n, isInput}, dm.UpperModelPEBound{n, isInput}];
        else
            % find limits from the model data
            data = [dm.ModelValues{n, isInput}];
        end
        dm.YLimits(n, :) = mbcmakelimits(data(:), 'loose');
    end
else
    dm.YLimits = zeros(0,2);
end