www.gusucode.com > mbctools 工具箱 matlab 源码程序 > mbctools/@xregbdrydev/pSetConstraint.m

    function bdev = pSetConstraint(bdev, con)
%PSETCONSTRAINT Direct access to object properties (PROTECTED)
%
%   *** WARNING ***
%   This method should only be used by XREGBDRYDEV and it's sub-classes.
%
%
%   BDEV = PSETCONSTRAINT(BDEV, CON)
%
%   Note that this set method does not reset the bdry dev stored on the 
%   heap. This left as the responsibility of the caller.
%
%   See also XREGBDRYDEV.

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

oldcon = bdev.Constraint;
bdev.Constraint = con;

if ~isempty(oldcon) && ~strcmp(typename(con),typename(oldcon))
    % reset options
    opts = getFitOptions(bdev,'all');
    bdev= setFitOptions(bdev,'all',opts);
end

xregpointer(bdev);