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

    function [fvals,OutofRange]= evalfeatures(f)
%EVALFEATURES evaluation response features
% 
% [fvals,OutofRange]= evalfeatures(f);
%  2nd output indicates whether rf is out of range

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



fvals= NaN(1,size(f.Values,1));
p= double(f);
for i=1:length(fvals);
    try
        fvals(i)= eval(f.Type(i).Function);
    end
end
if ~isreal(fvals)
   fvals(abs(imag(fvals))>1e-8)= NaN;
   fvals= real(fvals);
end
if nargout >1
   OutofRange= ~isfinite(fvals) |  fvals<f.Limits(1,:) | fvals>f.Limits(2,:);
end