Function Reference

Functions and Script Files

Defining Functions

nargin
Within a function, return the number of arguments passed to the function.
inputname
Return the text defining N-th input to the function.
silent_functions
Query or set the internal variable that controls whether internal output from a function is suppressed.

Multiple Return Values

nargout
Within a function, return the number of values the caller expects to receive.
nargchk
If N is in the range NARGIN_MIN through NARGIN_MAX inclusive, return the empty matrix.
nargoutchk
Return an appropriate error message string (or structure) if the number of outputs requested is invalid.

Variable-length Argument Lists

parseparams
Return in REG the cell elements of PARAM up to the first string element and in PROP all remaining elements beginning with the first string element.

Variable-length Return Lists

deal
Copy the input parameters into the corresponding output parameters.

Returning From a Function

return_last_computed_value
Not implemented.

Function Files

mfilename
Return the name of the currently executing file.
ignore_function_time_stamp
Query or set the internal variable that controls whether Octave checks the time stamp on files each time it looks up functions defined in function files.
addpath
Add DIR1, .
genpath
Return a path constructed from DIR and all its subdiretories.
rmpath
Remove DIR1, .
savepath
Save the current function search path to FILE.
path
Modify or display Octave's load path.
pathdef
Return the default path for Octave.
pathsep
Return the system-dependent character used to separate directories in a path.
rehash
Reinitialize Octave's load path directory cache.
file_in_loadpath
Return the absolute name of FILE if it can be found in the list of directories specified by `path'.
restoredefaultpath
Restore Octave's path to it's initial state at startup.
dispatch
Replace the function F with a dispatch so that function R is called when F is called with the first argument of the named TYPE.
builtin
Call the base function F even if F is overloaded to some other function for the given type signature.
autoload
Define FUNCTION to autoload from FILE.
mlock
Lock the current function into memory so that it can't be cleared.
munlock
Unlock the named function.
mislocked
Return true if the named function is locked.

Script Files

source
Parse and execute the contents of FILE.

Function Handles, Inline Functions, and Anonymous Functions

functions
Return a struct containing information about the function handle FCN_HANDLE.
func2str
Return a string containing the name of the function referenced by the function handle FCN_HANDLE.
str2func
Return a function handle constructed from the string FCN_NAME.
inline
Create an inline function from the character string STR.
argnames
Return a cell array of character strings containing the names of the arguments of the inline function FUN.
formula
Return a character string representing the inline function FUN.
vectorize
Create a vectorized version of the inline function FUN by replacing all occurrences of `*', `/', etc.
symvar
Identifies the argument names in the function defined by a string.

Commands

mark_as_command
Enter NAME into the list of commands.
unmark_command
Remove NAME from the list of commands.
iscommand
Return true if NAME is a command style function.
mark_as_rawcommand
Enter NAME into the list of raw input commands and to the list of command style functions.
unmark_rawcommand
Remove NAME from the list of raw input commands.
israwcommand
Return true if NAME is a raw input command function.