www.gusucode.com > mbcdesign 工具箱 matlab 源码程序 > mbcdesign/@conbase/isInside.m

    function in = isInside( con, X, in)
%ISINSIDE Check which points from a list are inside a constraint.
%
%  ISINSIDE(CON, X, IN) is a logical vector indicating which points in X
%  (N-by-nfactors) are within the constrained region. IN is a logical vector
%  indicating which points to constrain and which to ignore, i.e., which points
%  are currently considered to be "in" the constrained region.   
%
%  This is a default version that just works via the CONSTRAINTDISTANCE method.
%  Sub-classes where there is a more efficient way of computing points that are
%  inside or outside should overload this method.
%
%  See also CONBASE, CONBASE/CONSTRAINTDISTANCE, CONBASE/BRINGINSIDE.

%  Copyright 2000-2005 The MathWorks, Inc.

if any( in ),
    in(in) = constraintDistance( con, X(in,:) ) <= 0;
end

%------------------------------------------------------------------------------|
% EOF
%------------------------------------------------------------------------------|