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

    function root = removebest( root, best )
%REMOVEBEST Removes a model from the list of best models for a boundary tree
%
%  ROOT = REMOVEBEST(ROOT,BEST), where BEST is an XREGBDRYDEV, a pointer to an
%  XREGBDRYDEV or an index into the children of root.
%
%  See also: XREGBDRYDEV/ADDBEST, XREGBDRYDEV/SETBEST.

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


if isa( best, 'xregbdrydev' ),
    best = xregpointer( best );
    
elseif isa( best, 'numeric' ),
    c = children( root );
    best = c(best);
    
elseif ~isa( best, 'xregpointer' ),
    error(message('mbc:xregbdryroot:InvalidArgument'));
end

ind = findptrs( best, root.Best );
if all( ind > 0 ),
    root.Best(ind) = [];
end

xregpointer( root );