www.gusucode.com > mbcdesign 工具箱 matlab 源码程序 > mbcdesign/@conrange/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. % % See also CONRANGE, CONBASE/ISINSIDE. % Copyright 2000-2005 The MathWorks, Inc. X = pFilterFactors( con, X ); i = ones( nnz( in ), 1 ); in(in) = all( abs( X(in,:) - con.Center(i,:) ) <= con.HalfWidth(i,:), 2 ); %------------------------------------------------------------------------------| % EOF %------------------------------------------------------------------------------|