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

    function y = PredictedValue(R, X)
%PREDICTEDVALUE Calculate predicted value of response. 
% 
%   Y = PREDICTEDVALUE( RESPONSE, X);
%
% See also mbcmodel.response.PEV, mbcmodel.model.PredictedValue

%   Copyright 2004-2006 The MathWorks, Inc.

mdev = R.Object;
% Better check that the model is correctly fitted
if status(mdev) == 0
    error(message('mbc:mbcmodel:response:InvalidState2'));
end

if nargin < 2
    [X, Y, OK] = FitData(mdev);    
    X = double(X(OK, :));
end

% get  model
M = model(mdev);
y = M(X);