www.gusucode.com > mbcexpr 工具箱 matlab 源码程序 > mbcexpr/@cgnormfunction/evalAtInputs.m

    function out = evalAtInputs(obj, inputs)
%EVALATINPUTS Evaluate expression at given input values.
%
%  OUT = EVALATINPUTS(OBJ, INPUTS) returns the value of the expression at
%  the inputs values in INPUTS.  The cgnormfunction object returns
%  interpolated values for the from a table, at the first input value.

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


persistent fHdl

% Check to see if the object is full
if length(inputs)<1 || isempty(obj.Values)
    out = NaN;
else
    x = obj.Breakpoints;
    y = obj.Values;
    V = obj.Clips;
    if isempty(fHdl)
        fHdl= gethandle(cgmathsobject,'linear1');
    end
    if isempty(x)
        x = 0:(length(y)-1);
    end
    out = min(V(2),max(V(1),fHdl(x,y,inputs{1})));
end