www.gusucode.com > mbctools 工具箱 matlab 源码程序 > mbctools/@mdevtestplan/setInputSizes.m

    function T = setInputSizes(T,InputSizes)
%SETINPUTSIZES
%
% T = setInputSizes(T,InputSizes)

%  Copyright 2006-2014 The MathWorks, Inc. 


OldSizes = nfactors(T.DesignDev);

if isequal(OldSizes,InputSizes)
    return
end



if InputSizes(end)~=OldSizes(end)
    % make a hybrid RBF for last stage
    nf = InputSizes(end);
    m = xregCreateModel(@xreghybridrbf,nf);
    T.DesignDev.BaseModel = m;
end

if numel(InputSizes)==2
    % two-stage testplan
    if numel(OldSizes)==1
        NewLocal = true;
        d= designdev;
    else
        NewLocal = false;
        d = T.DesignDev(end);
    end
    if NewLocal || nfactors(d)~=InputSizes(1)
        
        % make all the symbols start with L
        LocalInputs = mbcinputfactor(InputSizes(1),'L');
        lm = xregCreateModel(@localsurface,LocalInputs);
        
        d.BaseModel=lm;
    end
    T.DesignDev= [d T.DesignDev(end)];
    if strcmp(name(T),'One-Stage')
        T = name(T,'Two-Stage');
    end
else
    if strcmp(name(T),'Two-Stage')
        T = name(T,'One-Stage');
    end
end

xregpointer(T);
T = info(T);