www.gusucode.com > mbcdesign 工具箱 matlab 源码程序 > mbcdesign/@xregdesign/private/pGetFlags.m

    function flgs = pGetFlags(obj, flagname)
%PGETFLAGS Return logical design point flags
%
%  FLAGS = PGETFLAGS(OBJ, FLAGNAME) returns the flags-per-design point that
%  are requested.  FLAGNAME can be one of 'FIXED' or 'DATA'.  FLG is a
%  logical vector the same length as the design indicating which points are
%  marked as true for the requested flag.

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


bitmask = uint8(0);

allflagnames = {'FIXED', 'DATA'};
bitindex = find( strcmp( flagname,allflagnames ) );

if isempty(bitindex)
    error(message('mbc:xregdesign:InvalidArgument5'));
else
    bitmask = bitset(bitmask, bitindex);
    flgs = bitand(obj.designpointflags, bitmask)>0;
end