www.gusucode.com > mbcmodels 工具箱 matlab 源码程序 > mbcmodels/@xregusermod/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
    Type = lower(getType(L));

    p = addprop(p,'Model',...
        @name,...
        @(m,v) iSetUDF(m,v),...
        'enum',getmodellist(L,nfactors(L)),...
        sprintf('Name of %s model',Type));
    p = addprop(p,'AlternativeModels',...
        @iGetModelList,...
        '','','',...
        sprintf('List of registered %s models',Type));
    
    PersistentStore(p,ID);
end

%% iSetUDF
function L = iSetUDF(L,v)

L = funcinit(L,v);

%% iGetModelList
function v = iGetModelList(L)

v= getmodellist(L,nfactors(L));