octave: Inline Functions

 
 11.11.3 Inline Functions
 ------------------------
 
 An inline function is created from a string containing the function body
 using the ‘inline’ function.  The following code defines the function
 f(x) = x^2 + 2.
 
      f = inline ("x^2 + 2");
 
 After this it is possible to evaluate f at any x by writing ‘f(x)’.
 
    *Caution*: MATLAB has begun the process of deprecating inline
 functions.  At some point in the future support will be dropped and
 eventually Octave will follow MATLAB and also remove inline functions.
 Use anonymous functions in all new code.
 
  -- : inline (STR)
  -- : inline (STR, ARG1, ...)
  -- : inline (STR, N)
      Create an inline function from the character string STR.
 
      If called with a single argument, the arguments of the generated
      function are extracted from the function itself.  The generated
      function arguments will then be in alphabetical order.  It should
      be noted that i and j are ignored as arguments due to the ambiguity
      between their use as a variable or their use as an built-in
      constant.  All arguments followed by a parenthesis are considered
      to be functions.  If no arguments are found, a function taking a
      single argument named ‘x’ will be created.
 
      If the second and subsequent arguments are character strings, they
      are the names of the arguments of the function.
 
      If the second argument is an integer N, the arguments are "x",
      "P1", ..., "PN".
 
      Programming Note: The use of ‘inline’ is discouraged and it may be
      removed from a future version of Octave.  The preferred way to
      create functions from strings is through the use of anonymous
      functions (SeeAnonymous Functions) or ‘str2func’.
 
      See also: Seeargnames XREFargnames, Seeformula XREFformula,
      Seevectorize XREFvectorize, Seestr2func XREFstr2func.
 
  -- : argnames (FUN)
      Return a cell array of character strings containing the names of
      the arguments of the inline function FUN.
 
      See also: Seeinline XREFinline, Seeformula XREFformula,
      Seevectorize XREFvectorize.
 
  -- : formula (FUN)
      Return a character string representing the inline function FUN.
 
      Note that ‘char (FUN)’ is equivalent to ‘formula (FUN)’.
 
DONTPRINTYET       See also: Seechar XREFchar, Seeargnames XREFargnames, *noteDONTPRINTYET       See also: Seechar XREFchar, Seeargnames XREFargnames, See
      inline XREFinline, Seevectorize XREFvectorize.
 
  -- : VARS = symvar (STR)
      Identify the symbolic variable names in the string STR.
 
      Common constant names such as ‘i’, ‘j’, ‘pi’, ‘Inf’ and Octave
      functions such as ‘sin’ or ‘plot’ are ignored.
 
      Any names identified are returned in a cell array of strings.  The
      array is empty if no variables were found.
 
      Example:
 
           symvar ("x^2 + y^2 == 4")
           ⇒ {
                [1,1] = x
                [2,1] = y
              }