www.gusucode.com > mbctools 工具箱 matlab 源码程序 > mbctools/@modeldev/checkmodel.m

    function OK= checkmodel(mdev)
%CHECKMODEL check the integrity of the model objects at load time 

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



OK=1;
if isa(mdev.Model,'xregmodel')
    OK= checkmodel(mdev.Model);
    yi= yinfo(mdev.Model);
    if strcmp(yi.Name,'y');
        % update all the model info
        mdev= modelinfo(mdev);
    end


    if isa(mdev.Model,'xregnnet') && ~isempty(mdev.Statistics) && mdev.Status
        % need to regenerate the summary statistics for neural networks
        [X,Y]= getdata(mdev);
        [mdev.Model,mdev.Statistics] = pUpdateR2(mdev.Model,X,Y,mdev.Statistics);
        xregpointer(mdev);
    end

else
    error(message('mbc:modeldev:InvalidObject', fullname( mdev )))
end