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

    function val = pGetModel(R, val)
%PGETMODEL Private function.
%
%   VAL = PGETMODEL( RESP, VAL )

%   Copyright 2004-2010 The MathWorks, Inc.
%       .

val = mbcutils.handleArray(0);
if R.isNotNull    
    m = model(R.Object);
    [X, Y, OK] = FitData(R.Object);
    % Initialise the internal store for the model
    m = InitModel(m, X, Y, [], 0);    
    val = mbcmodel.CreateModel( m,...
        'Response', R,...
        'ModelStatus', status(R.Object));
    val.pSetData(double(X(OK, :)), double(Y(OK, :)));
end