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

    function obj = set(obj,param,data)
%SET Set candidate set parameters
%
%   OBJ=SET(OBJ,PARAM,DATA)
%
%   PARAM may be one of:
%
%       Limits: Cell array of [Min Max] values
%       N     : Number of points
%    Pointset : Pointset object
%CacheScramble: true/false
%    Scramble : Name of scramble to use

%  Copyright 2007 The MathWorks, Inc.

switch lower(param)
    case 'limits'
        lims = cat(1,data{:});
        obj.candidateset = limits(obj.candidateset,lims);
    case 'n'
        obj.NPoints = data;
    case 'pointset'
        obj.PointSet = data;
    case 'cachescramble'
        obj.UseScrambleCache = data;
        if ~isempty(obj.ScrambleCache)
            % Set the pending scramble now
            obj.PointSet.ScrambleMethod = obj.ScrambleCache;
            obj.ScrambleCache = [];
        end
    case 'scramble'
        obj = i_SetScramble(obj, data);
end


function obj = i_SetScramble(obj, ScrambleType)
if isempty(ScrambleType)
    ScrambleStruct = struct('Type', {}, 'Options', {});
else
    ScrambleStruct = struct('Type', ScrambleType, 'Options', {{}});
end
if obj.UseScrambleCache
    obj.ScrambleCache = ScrambleStruct;
else
    obj.PointSet.ScrambleMethod = ScrambleStruct;
end