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

    function out = rhsevalAtInputs(obj, inputs)
%RHSEVALATINPUTS Evaluate constraint side at given input values.
%
%  OUT = RHSEVALATINPUTS(OBJ, INPUTS) returns the value of the right-hand
%  side of the constraint expression at the input values in INPUTS.  INPUTS
%  should be a cell array with a cell for each input to the expression that
%  contains a vector of input values. Each input should be a vector.  They
%  should all be either the same length or scalars.

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


if obj.ExprEvalFunc==1
    % LHS is boundary of expression => RHS=0 always
    out = 0;
elseif obj.CompValueType==0
    out = obj.CompValue;
elseif ~isempty(inputs)
    out = inputs{1};
else
    out = NaN;
end