www.gusucode.com > mbcdata 工具箱 matlab 源码程序 > mbcdata/@cgsumconstraint/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 2005-2006 The MathWorks, Inc. and Ford Global Technologies, Inc. if nargin<2 type = 'Evaluate'; end pExpr = obj.Expression; if isvalid(pExpr) switch type case {'Evaluate', 'NaturalEvaluate', 'LHSEvaluate'} EvalFuncs = {'evalAtInputs'}; case 'RHSEvaluate' % Static bound does not need any expression calculation pExpr = mbcpointer(1,0); EvalFuncs = {}; otherwise EvalFuncs = {''}; end else pExpr = mbcpointer(1,0); EvalFuncs = {}; end