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

    function y = subsref(m, S)
%SUBSREF Overloaded subsref method that allows evaluation of models
%
%  Y = MODEL( X ) Evaluates the NF input model at X.  X is a (N-by-NF) array,
%  where N the number of points to evaluate the model at.
%
%  See also EvalModel, pev

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

if length(S)==1 && strcmp(S.type,'()')  
    if ~isscalar(S.subs)
        error(message('mbc:xregexportmodel:InvalidSize'));
    end
    NF = nfactors( m );
    if NF==size(S.subs{1},2)
        y = EvalModel(m,S.subs{:});
    else
        str = '';
        if NF>1
            str = 's';
        end            
        error(message('mbc:xregexportmodel:InvalidSize1', NF, str));
    end
else
   error(message('mbc:xregexportmodel:InvalidArgument4'));
end