function INLINE_OUT_ = subsref(INLINE_OBJ_, INLINE_SUBS_)
%SUBSREF Evaluate INLINE object.

%   Steven L. Eddins, August 1995
%   Copyright (c) 1984-98 by The MathWorks, Inc.
%   $Revision: 1.9 $  $Date: 1997/11/21 23:30:36 $

if (INLINE_OBJ_.isEmpty)
  error('Can''t call an empty inline function.');
end

INLINE_INPUTS_ = INLINE_SUBS_.subs;
if (length(INLINE_INPUTS_) < INLINE_OBJ_.numArgs)
  error('Not enough inputs to inline function.');
elseif (length(INLINE_INPUTS_) > INLINE_OBJ_.numArgs)
  error('Too many inputs to inline function.');
end

if (isempty(INLINE_OBJ_.expr))
  INLINE_OUT_ = [];
else
  eval(INLINE_OBJ_.inputExpr);
  INLINE_OBJ_catch = ['error(sprintf(''Error in inline expression',...
                      ' ==> %s\n??? %s'',INLINE_OBJ_.expr,lasterr))'];
  INLINE_OUT_ = eval(INLINE_OBJ_.expr,INLINE_OBJ_catch);
end

