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

    function M = UpdateResponse(M,R)
%UPDATERESPONSE Updates model in the response 
%
%   UPDATERESPONSE( M ) updates model in the response associated with the model.
%   M = UPDATERESPONSE( M , R); updates the response specified by R

%   Copyright 2004-2006 The MathWorks, Inc.

if nargin>1
    if ~isa(R,'mbcmodel.response')
        error(message('mbc:mbcmodel:InvalidValue'));
    end
    M.Response = R;
else
    R = M.Response;
end

if ~isempty(R) && ishandle(R) && R.isNotNull 
    R.Model = M;
else
    error(message('mbc:mbcmodel:InvalidState'));
end