www.gusucode.com > mbcexpr 工具箱 matlab 源码程序 > mbcexpr/@cgconconstraint/getDistanceScale.m

    function ds = getDistanceScale(obj)
%GETDISTANCESCALE Get the notional range of the object
%
%  DS = GETDISTANCESCALE(OBJ) returns the notional range of the object.
%  This is directly estimated from the expression held in the object.

%  Copyright 2005 The MathWorks, Inc. and Ford Global Technologies, Inc.


% Evaluate the constraint over a space filling design of its inputs
out = evaluateOverDesign(obj, @i_natevalAtInputs);

% Return interquartile range as the notional range
ds = prctile(out, [25 75]);

%--------------------------------------------------------------------------
function out = i_natevalAtInputs(obj)
%--------------------------------------------------------------------------

inps = getinputs(obj);
% This is potentially dodgy, as I'm relying on the correct input values
% being set by the caller
inputcell = pveceval(inps, @getvalue);
out = natevalAtInputs(obj, inputcell);