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

    function obj = setoperator(obj, op)
%SETOPERATOR Set the operator function 
%
%  OBJ = SETOPERATOR(OBJ, OP) sets the operator being used by the
%  constraint.  OP must be one of 'le', 'ge' or 'eq'.

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


if ~any(strcmp(op, {'le','ge', 'eq'}))
    error(message('mbc:cgexprconstraint:InvalidArgument1')); 
end
obj.CompOperator = str2func(op);
obj.DistOperator = pgetdistop(obj, op);