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

    function p = designproperties(c,p,m)
%DESIGNPROPERTIES properties for command-line
%
% p = designproperties(c,p)

%  Copyright 2007 The MathWorks, Inc.

CLSID = mfilename('class');
[p,OK] = PersistentStore(p,CLSID);
if ~OK
    p = iMakeProps(c,p,m);
    PersistentStore(p,CLSID);
end


function p = iMakeProps(c,p,m)

p = designproperties(c.candidateset,p,m);

p = addprop(p,'StratifyLevels',...
    @iGetStratifyLevels,...
    @iSetStratifyLevels,...
    'vector int',{[0 Inf],nfactors(c)},...
    'Number of levels for each factors');

p = addprop(p,'NumberOfPoints',...
    @iGetRuns, @iSetRuns,...
    'int',[0 Inf],...
    'Number of points'); 

p = addprop(p,'PrimeGenerators',...
    @iGetGenerators, @iSetGenerators,...
    'vector int',{[0 Inf],nfactors(c)},...
    'Prime number generators for lattice for each input'); 

function v = iGetGenerators(c,m)

v = get(c,'g');

function c = iSetGenerators(c,v,m)

if any(~isprime(v))
   error(message('mbc:doe:InvalidValue34'))
end
c = set(c,'g',v);


function v = iGetRuns(c,m)

v = get(c,'N');

function c = iSetRuns(c,v,m)

c = set(c,'N',v);



function v = iGetStratifyLevels(c,m)
v = get(c,'nLevels');

function c = iSetStratifyLevels(c,v,m)

c = set(c,'nLevels',v);