www.gusucode.com > mbcdesign 工具箱 matlab 源码程序 > mbcdesign/@cset_lhs/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
%       CostMethod  : String ({'maximin'},'minimax','discrepancy')
%       OptimMethod : String ({'random'})
%       N       : Number of points
%       doRecalc : 0/1
%       doQuickRecalc: recalculates with the number of iterations specified.
%       showGUI: 0/1  shows a waitbar while finding a LHS
%       stratifyLevels:  vector of number of levels to stratify to.  0's imply
%                        no stratification on that factor.  -1 means that
%                        the levels will be taken from the "exactlevels"
%                        property value
%       exactlevels:  cell array of exact level settings for stratified
%                     factors
%       symmetric: 0/1 sets the LHS to have inherent symmetry

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


switch lower(param)
    case 'limits'
        lims=cat(1,data{:});
        obj = limits(obj, lims);
    case 'costmethod'
        obj.alg=data;
        obj = reset(obj);
    case 'optimmethod'
        obj.optimalg=data;
        obj = reset(obj);
    case 'n'
        obj.N=data;
        obj.delta= (diff(limits(obj),1,2)')./(obj.N-1);
        obj = reset(obj);
    case 'dorecalc'
        if data
            data=500;
        end
        obj.doRecalc=data;
    case 'showgui'
        obj.guiflag=data;
    case 'stratifylevels'
        obj.stratify=data;
        obj = reset(obj);
    case 'exactlevels'
        obj.stratify_levels=data;
        obj = reset(obj);
    case 'symmetric'
        obj.symmetry=data;
        obj = reset(obj);
end

obj = pGeneratePoints(obj);