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

    function varargout=set(m,Property,Value)
%SET

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



switch lower(Property)
    case 'status'
        if length(Value)~=length(m.Beta)
            error(message('mbc:xreglinear:InvalidValue'))
        end

        m.TermStatus= Value;

        % force terms in the model if status==1
        m.TermsOut(Value==1)= false;
        % force terms out of model  if status==2
        m.TermsOut(Value==2)= true;
        m.Beta(Value==2)= 0;
    case 'store'
        m.Store=Value;
    case 'lambda'
        m.lambda= Value;
    case 'qr'
        m.qr= Value;
    case 'constant'
        m.Constant = Value;
    otherwise
        m.xregmodel=set(m.xregmodel,Property,Value);
end
if nargout==1
    varargout{1}=m;
else
    assignin('caller',inputname(1),m);
end