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

    function y = EvalModel(M,x,varargin)
%EVALMODEL Evaluate a model
%    Y = EVALMODEL( MODEL, X ) evaluates the model at input values X.  X is a
%    (N-by-NF) array, where NF is the number of inputs, and N the number of
%    points to evaluate the model at.
%
%    Models can also be evaluated using parentheses.
%      y = Model(X);
%
%    See also pev, predint, ceval

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

% check the number of inputs and outputs
narginchk(2,2);
nargoutchk(0,1);

m = M.mvModel;

% we are passed a numeric array - check it has the right size
NF = nfactors( m );
if NF==size(x,2)
    Xg = x;
else
    str = '';
    if NF>1
        str = 's';
    end
    error(message('mbc:xregstatsmodel:InvalidSize', NF, str));
end

y = EvalModel( m, Xg, varargin{:} );