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

    function p = modelproperties(L,p)
%MODELPROPERTIES interface to model properties
%
% p = modelproperties(m,p);

%  Copyright 2006-2007 The MathWorks, Inc.

ID = p.Type;
[p,OK] = PersistentStore(p,ID);
if ~OK
    % Use user defined properties
    p = modelproperties(L.userdefined,p);

    % redirect get and set functions to L.userdefined
    p = redirect(p,@iGetInternal,@iSetInternal);

    % remove BoxCox
    p = rmprop(p,'BoxCox');

    % standard localmod properties
    p = modelproperties(L.localmod,p,L);
    
    PersistentStore(p,ID);
end

%% iGetInternal
function v = iGetInternal(fGet,L)
u = get(L,'model');
v = fGet(u);

%% iSetInternal
function Lout = iSetInternal(fSet,L,v)

u = get(L,'model');
u = fSet(u,v);
Lout = set(L,'model',u);
if ~isequal(Lout,L)
    Lout= SetFeat(Lout,'default');
end