www.gusucode.com > mbcdata 工具箱 matlab 源码程序 > mbcdata/@cgtabgradconstraint/private/pIdentityGridFilter.m

    function map = pIdentityGridFilter(axisbp, pts)
%PIDENTITYGRIDFILTER Filter the grid points using an identity map
%
%   MAP = PCONVHULLGRIDFILTER(AXISBP, PTS) returns a boolean map which
%   indicates whether each grid point is inside the boundary of the data.
%   The grid points are specified by the 1-by-NAXIS cell array of axis
%   breakpoints, AXISBP.
%
%   All grid points are used.
%
%   See also PCONVHULLGRIDFILTER

%   Copyright 2006 The MathWorks, Inc.

% If there are no axis variables then just return empty
if length(axisbp) < 1
    map = [];
    return
end

% If no data is specified, then return an empty map
if isempty(pts)
    map = [];
    return
end

% Return a map that admits all grid points
bpsize = cellfun('prodofsize', axisbp);
if numel(bpsize) == 1
    bpsize = [bpsize, 1];
end
map = true(bpsize);