www.gusucode.com > mbcmodels 工具箱 matlab 源码程序 > mbcmodels/@xregrbf/simSetEvalParam.m

    function simSetEvalParam(m,sys)
%XREGRBF/SIMSETEVALPARAM Sets the simulink parameters required to evaluate
%an RBF model in simulink
%
%   SIMSETEVALPARAM(M,SYS) sets the parameters in the simulink system SYS
%   required to evaluate the RBF model M.

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


vars = {'center','width','beta','nfactors'};

% Need to remove terms which have been taken out by stepwise
termsIn = find(Terms(m));
center = m.centers(termsIn,:);
beta = double(m);
beta = beta(termsIn);
width = m.width;
if size( width, 1 ) > 1,
    width = width(termsIn,:);
end

% Centers
values{1} = center;
values{2} = width.^2;
values{3} = beta;
values{4} = get(m,'nfactors');

AddVariablesToUserdata(sys,vars,values);