www.gusucode.com > mbcdata 工具箱 matlab 源码程序 > mbcdata/@cgrangeconstraint/getStaticExpressions.m

    function [pExpr, EvalFuncs] = getStaticExpressions(obj, type)
%GETSTATICEXPRESSIONS Get expressions that are required by static methods
%
%  [PEXPR, EVALFUNCS] = GETSTATICEXPRESSIONS(OBJ) returns a list of
%  expression pointers and associated evaluation functions for each one.
%  These expression/function pairs are the ones that the item will need
%  access to in its static methods.
%
%  [PEXPR, EVALFUNCS] = GETSTATICEXPRESSIONS(OBJ, OP) specifies the
%  operation that the static data is required for.  The default value is
%  'Evaluate'.  All items also support 'NaturalEvaluate'.  Constraints also
%  support 'LHSEvaluate' and 'RHSEvaluate'.

%   Copyright 2006 The MathWorks, Inc.

% Static expressions are just the contained bound constraints
pExpr = [obj.LowerBound, obj.UpperBound];

% Determine the evaluation functions
if nargin<2
    type = 'Evaluate';
end
switch type
    case 'Evaluate'
        if isOutputScaled(obj)
            EvalFuncs = {'evalAtInputs'};
        else
            EvalFuncs = {'natevalAtInputs'};
        end
    case 'NaturalEvaluate'
        EvalFuncs = {'natevalAtInputs'};
    case 'LHSEvaluate'
        EvalFuncs = {'lhsevalAtInputs'};
    case 'RHSEvaluate'
        EvalFuncs = {'rhsevalAtInputs'};
    otherwise
        EvalFuncs = {''};
end
EvalFuncs = EvalFuncs(ones(1, 2));