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

    function p = modelproperties(m,p)
%MODELPROPERTIES interface to model properties
%
% p = modelproperties(m,p);
%     combination of linear and rbf parts

%  Copyright 2006-2007 The MathWorks, Inc.

ID = p.Type;
[p,OK] = PersistentStore(p,ID);
if ~OK
    %% Linear Properties
    p = modelproperties(m.linearmodpart,p);
    % Type name dependent on linear type
    if isprop(p,'TransformInputRange')
        % remove TransformInputRange property as this isn't relevant for
        % hybrid rbfs
        p = rmprop(p,'TransformInputRange');
    end
    % redirect get and set functions to m.linearmodpart
    p = redirect(p,@iGetLinearPart,@iSetLinearPart);

    linprops = properties(p);

    %% RBF Properties
    p = modelproperties(m.rbfpart,p);
    % redirect get and set functions to m.rbfpart
    p = redirect(p,@iGetRBFPart,@iSetRBFPart,setdiff(properties(p),linprops));

    %% base linear properties
    p = modelproperties(m.xreglinear,p);

    
    PersistentStore(p,ID);
end


%% iGetLinearPart
function v = iGetLinearPart(fGet,m)

v = fGet(m.linearmodpart);

%% iSetLinearPart
function m = iSetLinearPart(fSet,m,v)

mlin = fSet(m.linearmodpart,v);
set(m,'linearmodpart',mlin)
m = reset(m);

%% iGetRBFPart
function v = iGetRBFPart(fGet,m)

v = fGet(m.rbfpart);

%% iSetRBFPart
function m = iSetRBFPart(fSet,m,v)

mrbf = fSet(m.rbfpart,v);
set(m,'rbfpart',mrbf)
m = reset(m);