Previous: Function Handles, Up: Function Handles and Inline


13.9.2 Inline Functions

— Built-in Function: inline (str)
— Built-in Function: inline (str, arg1, ...)
— Built-in Function: 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 inbuilt constant. All arguments followed by a parentheses are considered to be functions.

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".

— Built-in Function: argnames (fun)

Return a cell array of character strings containing the names of the arguments of the inline function fun.

— Built-in Function: formula (fun)

Return a character string representing the inline function fun. Note that char (fun) is equivalent to formula (fun).

— Built-in Function: argnames (fun)

Create a vectorized version of the inline function fun by replacing all occurrences of *, /, etc., with .*, ./, etc.