www.gusucode.com > mbc 工具箱 matlab 源码程序 > mbc/@mbcmodel/@model/subsasgn.m

    function mout = subsasgn(mdl,S,V)
%SUBSASGN
%
% mdl.Properties.PropName = NewValue;
% mdl.FitAlgorithm.PropName = NewValue;

%   Copyright 2006-2007 The MathWorks, Inc.

if strcmp(S(1).type,'.')
    if length(S)>1
        % subassign property
        res = mdl.(S(1).subs);
        V = subsasgn(res,S(2:end),V);
    end
    if any(strcmp(S(1).subs,{'Properties','FitAlgorithm'}))
        % make a copy of the object
        mout = copy(mdl);
    else
        mout = mdl;
    end
    mout.(S(1).subs) = V;
else
    error(message('mbc:mbcmodel:model:InvalidAssignmentType'))
end