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

    function out = partialset(obj,ind)
%PARTIALSET Return the partial list of candidate points
%
%  LIST=PARTIALSET(OBJ,IND) returns the partial list of points in the
%  candidate set.

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


if ~isempty(ind)
    % number of points in each dimension
    s = cellfun('length',obj.levels);
    s = s(:)';

    % initialise cand
    out = zeros(length(ind),length(obj.levels));

    ind2 = fastind2sub(s,ind);
    for n = 1:length(s)
        x = obj.levels{n}(:);
        out(:,n) = x(ind2(length(s)-n+1,:));
    end
else
    out = [];
end