www.gusucode.com > mbcexpr 工具箱 matlab 源码程序 > mbcexpr/@cglookup/private/pSetExtrapolationRegions.m

    function obj = pSetExtrapolationRegions(obj, mask)
%PSETEXTRAPOLATIONREGIONS Set new extrapolation regions mask
%
%  OBJ = PSETEXTRAPOLATIONREGIONS(OBJ, MASK) sets a new regions mask for
%  the table.  The mask must be a logical matrix the same size as the
%  table's values matrix or an empty logical matrix.

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


if isempty(mask)
    obj.ExtrapolationRegions = true(0);
else
    if all(size(mask)==size(get(obj, 'values')))
        if ~any(mask(:))
            % Compress empty masks down to an empty matrix.  The full
            % matrix is restored on demand by getExtrapolationRegions.
            obj.ExtrapolationRegions = true(0);
        else
            obj.ExtrapolationRegions = logical(mask);
        end
    else
        error(message('mbc:cglookup:InvalidSize9'));
    end
end