Navigation

Operators and Keywords

Function List:

C++ API

octave

GNU Octave comes with a large set of general-purpose functions that are listed below. This is the core set of functions that is available without any packages installed.

Select category:

General

citation
Display instructions for citing GNU Octave or its packages in publications.

Invoking Octave from the Command Line

argv
Return the command line arguments passed to Octave.
program_name
Return the last component of the value returned by 'program_invocation_name'.
program_invocation_name
Return the name that was typed at the shell prompt to run Octave.

Quitting Octave

quit
Exit the current Octave session.
atexit
Register a function to be called when Octave exits.

Commands for Getting Help

help
Display the help text for NAME.
doc
Display documentation for the function FUNCTION_NAME directly from an online version of the printed manual, using the GNU Info browser.
lookfor
Search for the string STR in the documentation of all functions in the current function search path.
news
Display the current NEWS file for Octave or an installed package.
info
Display contact information for the GNU Octave community.
warranty
Describe the conditions for copying and distributing Octave.
info_file
Query or set the internal variable that specifies the name of the Octave info file.
info_program
Query or set the internal variable that specifies the name of the info program to run.
makeinfo_program
Query or set the internal variable that specifies the name of the program that Octave runs to format help text containing Texinfo markup commands.
texi_macros_file
Query or set the internal variable that specifies the name of the file containing Texinfo macros that are prepended to documentation strings before they are passed to makeinfo.
doc_cache_file
Query or set the internal variable that specifies the name of the Octave documentation cache file.
built_in_docstrings_file
Query or set the internal variable that specifies the name of the file containing docstrings for built-in Octave functions.
suppress_verbose_help_message
Query or set the internal variable that controls whether Octave will add additional help information to the end of the output from the 'help' command and usage messages for built-in commands.
doc_cache_create
Generate documentation cache for all functions in DIRECTORY.
get_help_text
Return the raw help text of function NAME.
get_help_text_from_file
Return the raw help text from the file FNAME.
get_first_help_sentence
Return the first sentence of a function's help text.

Command Line Editing

clc
Clear the terminal screen and move the cursor to the upper left corner.
completion_append_char
Query or set the internal character variable that is appended to successful command-line completion attempts.
completion_matches
Generate possible completions given HINT.
history
If invoked with no arguments, 'history' displays a list of commands that you have executed.
edit_history
Edit the history list using the editor named by the variable 'EDITOR'.
run_history
Run commands from the history list.
history_save
Query or set the internal variable that controls whether commands entered on the command line are saved in the history file.
history_control
Query or set the internal variable that specifies how commands are saved to the history list.
history_file
Query or set the internal variable that specifies the name of the file used to store command history.
history_size
Query or set the internal variable that specifies how many entries to store in the history file.
history_timestamp_format_string
Query or set the internal variable that specifies the format string for the comment line that is written to the history file when Octave exits.
EDITOR
Query or set the internal variable that specifies the default text editor.
readline_read_init_file
Read the readline library initialization file FILE.
readline_re_read_init_file
Re-read the last readline library initialization file that was read.
PS1
Query or set the primary prompt string.
PS2
Query or set the secondary prompt string.
PS4
Query or set the character string used to prefix output produced when echoing commands is enabled.
diary
Record a list of all commands _and_ the output they produce, mixed together just as they appear on the terminal.
echo
Control whether commands are displayed as they are executed.
echo_executing_commands
Query or set the internal variable that controls the echo state.

General

typeinfo
Return the type of the expression EXPR, as a string.

Built-in Data Types

class
Return the class of the object OBJ, or create a class with fields from structure S and name (string) ID.
isa
Return true if OBJ is an object from the class CLASSNAME.
cast
Convert VAL to data type TYPE.
typecast
Return a new array Y resulting from interpreting the data of X in memory as data of the numeric class CLASS.
swapbytes
Swap the byte order on values, converting from little endian to big endian and vice versa.
bitpack
Return a new array Y resulting from interpreting the logical array X as raw bit patterns for data of the numeric class CLASS.
bitunpack
Return a logical array Y corresponding to the raw bit patterns of X.
NA
Return a scalar, matrix, or N-dimensional array whose elements are all equal to the special constant used to designate missing values.
isna
Return a logical array which is true where the elements of X are NA (missing) values and false where they are not.

Object Sizes

ndims
Return the number of dimensions of A.
columns
Return the number of columns of A.
rows
Return the number of rows of A.
numel
Return the number of elements in the object A.
length
Return the length of the object A.
size
Return a row vector with the size (number of elements) of each dimension for the object A.
isempty
Return true if A is an empty matrix (any one of its dimensions is zero).
isnull
Return true if X is a special null matrix, string, or single quoted string.
sizeof
Return the size of VAL in bytes.
size_equal
Return true if the dimensions of all arguments agree.
squeeze
Remove singleton dimensions from X and return the result.

General

double
Convert X to double precision type.
complex
Return a complex value from real arguments.

Matrices

sizemax
Return the largest value allowed for the size of an array.
output_max_field_width
Query or set the internal variable that specifies the maximum width of a numeric output field.
output_precision
Query or set the internal variable that specifies the minimum number of significant figures to display for numeric output.
split_long_rows
Query or set the internal variable that controls whether rows of a matrix may be split when displayed to a terminal window.
fixed_point_format
Query or set the internal variable that controls whether Octave will use a scaled format to print matrix values.
print_empty_dimensions
Query or set the internal variable that controls whether the dimensions of empty matrices are printed along with the empty matrix symbol, '[]'.

Ranges

disable_range
Query or set the internal variable that controls whether ranges are stored in a special space-efficient format.

Single Precision Data Types

single
Convert X to single precision type.

Integer Data Types

isinteger
Return true if X is an integer object (int8, uint8, int16, etc.).
int8
Convert X to 8-bit integer type.
uint8
Convert X to unsigned 8-bit integer type.
int16
Convert X to 16-bit integer type.
uint16
Convert X to unsigned 16-bit integer type.
int32
Convert X to 32-bit integer type.
uint32
Convert X to unsigned 32-bit integer type.
int64
Convert X to 64-bit integer type.
uint64
Convert X to unsigned 64-bit integer type.
intmax
Return the largest integer that can be represented in an integer type.
intmin
Return the smallest integer that can be represented in an integer type.
flintmax
Return the largest integer that can be represented consecutively in a floating point value.
idivide
Integer division with different rounding rules.

Bit Manipulations

bitset
Set or reset bit(s) N of the unsigned integers in A.
bitget
Return the status of bit(s) N of the unsigned integers in A.
bitand
Return the bitwise AND of non-negative integers.
bitor
Return the bitwise OR of non-negative integers X and Y.
bitxor
Return the bitwise XOR of non-negative integers X and Y.
bitcmp
Return the K-bit complement of integers in A.
bitshift
Return a K bit shift of N-digit unsigned integers in A.

Logical Values

logical
Convert the numeric object X to logical type.
true
Return a matrix or N-dimensional array whose elements are all logical 1.
false
Return a matrix or N-dimensional array whose elements are all logical 0.

Predicates for Numeric Objects

isnumeric
Return true if X is a numeric object, i.e., an integer, real, or complex array.
islogical
Return true if X is a logical object.
isfloat
Return true if X is a floating-point numeric object.
isreal
Return true if X is a non-complex matrix or scalar.
iscomplex
Return true if X is a complex-valued numeric object.
ismatrix
Return true if A is a 2-D array.
isvector
Return true if X is a vector.
isrow
Return true if X is a row vector 1xN with non-negative N.
iscolumn
Return true if X is a column vector Nx1 with non-negative N.
isscalar
Return true if X is a scalar.
issquare
Return true if X is a square matrix.
issymmetric
Return true if A is a symmetric matrix within the tolerance specified by TOL.
ishermitian
Return true if A is Hermitian within the tolerance specified by TOL.
isdefinite
Return 1 if A is symmetric positive definite within the tolerance specified by TOL or 0 if A is symmetric positive semidefinite.
isbanded
Return true if A is a matrix with entries confined between LOWER diagonals below the main diagonal and UPPER diagonals above the main diagonal.
isdiag
Return true if A is a diagonal matrix.
istril
Return true if A is a lower triangular matrix.
istriu
Return true if A is an upper triangular matrix.
isprime
Return a logical array which is true where the elements of X are prime numbers and false where they are not.

Escape Sequences in String Constants

is_dq_string
Return true if X is a double-quoted character string.
is_sq_string
Return true if X is a single-quoted character string.

Character Arrays

ischar
Return true if X is a character array.
string_fill_char
Query or set the internal variable used to pad all rows of a character matrix to the same length.

Creating Strings

blanks
Return a string of N blanks.
char
Create a string array from one or more numeric matrices, character matrices, or cell arrays.
strvcat
Create a character array from one or more numeric matrices, character matrices, or cell arrays.
strcat
Return a string containing all the arguments concatenated horizontally.
cstrcat
Return a string containing all the arguments concatenated horizontally with trailing white space preserved.
mat2str
Format real, complex, and logical matrices as strings.
num2str
Convert a number (or array) to a string (or a character array).
int2str
Convert an integer (or array of integers) to a string (or a character array).

Comparing Strings

strcmp
Return 1 if the character strings S1 and S2 are the same, and 0 otherwise.
strncmp
Return 1 if the first N characters of strings S1 and S2 are the same, and 0 otherwise.
strcmpi
Return 1 if the character strings S1 and S2 are the same, disregarding case of alphabetic characters, and 0 otherwise.
strncmpi
Return 1 if the first N character of S1 and S2 are the same, disregarding case of alphabetic characters, and 0 otherwise.

Manipulating Strings

deblank
Remove trailing whitespace and nulls from S.
strtrim
Remove leading and trailing whitespace from S.
strtrunc
Truncate the character string S to length N.
findstr
Return the vector of all positions in the longer of the two strings S and T where an occurrence of the shorter of the two starts.
strchr
Search for the string STR for occurrences of characters from the set CHARS.
index
Return the position of the first occurrence of the string T in the string S, or 0 if no occurrence is found.
rindex
Return the position of the last occurrence of the character string T in the character string S, or 0 if no occurrence is found.
strfind
Search for PATTERN in the string STR and return the starting index of every such occurrence in the vector IDX.
strjoin
Join the elements of the cell string array, CSTR, into a single string.
strmatch
Return indices of entries of A which begin with the string S.
strtok
Find all characters in the string STR up to, but not including, the first character which is in the string DELIM.
strsplit
Split the string STR using the delimiters specified by DEL and return a cell string array of substrings.
ostrsplit
Split the string S using one or more separators SEP and return a cell array of strings.
strread
Read data from a string.
strrep
Replace all occurrences of the pattern PTN in the string STR with the string REP and return the result.
substr
Return the substring of S which starts at character number OFFSET and is LEN characters long.
regexp
Regular expression string matching.
regexpi
Case insensitive regular expression string matching.
regexprep
Replace occurrences of pattern PAT in STRING with REPSTR.
regexptranslate
Translate a string for use in a regular expression.
untabify
Replace TAB characters in T with spaces.

String Conversions

bin2dec
Return the decimal number corresponding to the binary number represented by the string S.
dec2bin
Return a binary number corresponding to the non-negative integer D, as a string of ones and zeros.
dec2hex
Return the hexadecimal string corresponding to the non-negative integer D.
hex2dec
Return the integer corresponding to the hexadecimal number represented by the string S.
dec2base
Return a string of symbols in base BASE corresponding to the non-negative integer D.
base2dec
Convert S from a string of digits in base BASE to a decimal integer (base 10).
num2hex
Typecast a double or single precision number or vector to a 8 or 16 character hexadecimal string of the IEEE 754 representation of the number.
hex2num
Typecast the 16 character hexadecimal character string to an IEEE 754 double precision number.
str2double
Convert a string to a real or complex number.
strjust
Return the text, S, justified according to POS, which may be "left", "center", or "right".
str2num
Convert the string (or character array) S to a number (or an array).
toascii
Return ASCII representation of S in a matrix.
tolower
Return a copy of the string or cell string S, with each uppercase character replaced by the corresponding lowercase one; non-alphabetic characters are left unchanged.
toupper
Return a copy of the string or cell string S, with each lowercase character replaced by the corresponding uppercase one; non-alphabetic characters are left unchanged.
do_string_escapes
Convert escape sequences in STRING to the characters they represent.
undo_string_escapes
Convert special characters in strings back to their escaped forms.

Character Class Functions

isalnum
Return a logical array which is true where the elements of S are letters or digits and false where they are not.
isalpha
Return a logical array which is true where the elements of S are letters and false where they are not.
isletter
Return a logical array which is true where the elements of S are letters and false where they are not.
islower
Return a logical array which is true where the elements of S are lowercase letters and false where they are not.
isupper
Return a logical array which is true where the elements of S are uppercase letters and false where they are not.
isdigit
Return a logical array which is true where the elements of S are decimal digits (0-9) and false where they are not.
isxdigit
Return a logical array which is true where the elements of S are hexadecimal digits (0-9 and a-fA-F).
ispunct
Return a logical array which is true where the elements of S are punctuation characters and false where they are not.
isspace
Return a logical array which is true where the elements of S are whitespace characters (space, formfeed, newline, carriage return, tab, and vertical tab) and false where they are not.
iscntrl
Return a logical array which is true where the elements of S are control characters and false where they are not.
isgraph
Return a logical array which is true where the elements of S are printable characters (but not the space character) and false where they are not.
isprint
Return a logical array which is true where the elements of S are printable characters (including the space character) and false where they are not.
isascii
Return a logical array which is true where the elements of S are ASCII characters (in the range 0 to 127 decimal) and false where they are not.
isstrprop
Test character string properties.

Structures

struct_levels_to_print
Query or set the internal variable that specifies the number of structure levels to display.
print_struct_array_contents
Query or set the internal variable that specifies whether to print struct array contents.
struct
Create a scalar or array structure and initialize its values.
isstruct
Return true if X is a structure or a structure array.
numfields
Return the number of fields of the structure S.
fieldnames
Return a cell array of strings with the names of the fields in the specified input.
isfield
Return true if the X is a structure and it includes an element named NAME.
setfield
Return a _copy_ of the structure S with the field member FIELD set to the value VAL.
getfield
Get the value of the field named FIELD from a structure or nested structure S.
rmfield
Return a _copy_ of the structure (array) S with the field F removed.
orderfields
Return a _copy_ of S1 with fields arranged alphabetically, or as specified by the second input.
substruct
Create a subscript structure for use with 'subsref' or 'subsasgn'.
struct2cell
Create a new cell array from the objects stored in the struct object.

Cell Arrays

celldisp
Recursively display the contents of a cell array.
iscell
Return true if X is a cell array object.
cell
Create a new cell array object.
num2cell
Convert the numeric matrix A to a cell array.
mat2cell
Convert the matrix A to a cell array.
cellslices
Given an array X, this function produces a cell array of slices from the array determined by the index vectors LB, UB, for lower and upper bounds, respectively.
cellindexmat
Perform indexing of matrices in a cell array.
cellstr
Create a new cell array object from the elements of the string array STRMAT.
iscellstr
Return true if every element of the cell array CELL is a character string.
cell2mat
Convert the cell array C into a matrix by concatenating all elements of C into a hyperrectangle.
cell2struct
Convert CELL to a structure.

General

ans
The most recently computed result that was not explicitly assigned to a variable.
isvarname
Return true if NAME is a valid variable name.
genvarname
Create valid unique variable name(s) from STR.
namelengthmax
Return the MATLAB compatible maximum variable name length.

Global Variables

isglobal
Return true if NAME is a globally visible variable.

Status of Variables

who
List currently defined variables matching the given patterns.
whos
Provide detailed information on currently defined variables matching the given patterns.
whos_line_format
Query or set the format string used by the command 'whos'.
exist
Check for the existence of NAME as a variable, function, file, directory, or class.
clear
Delete the names matching the given patterns from the symbol table.
pack
Consolidate workspace memory in MATLAB.
type
Display the contents of NAME which may be a file, function (m-file), variable, operator, or keyword.
which
Display the type of each NAME.
what
List the Octave specific files in directory DIR.

Index Expressions

sub2ind
Convert subscripts to linear indices.
ind2sub
Convert linear indices to subscripts.
isindex
Return true if IND is a valid index.
allow_noninteger_range_as_index
Query or set the internal variable that controls whether non-integer ranges are allowed as indices.

Calling Functions

max_recursion_depth
Query or set the internal limit on the number of times a function may be called recursively.

Arithmetic Operators

ctranspose
Return the complex conjugate transpose of X.
ldivide
Return the element-by-element left division of X and Y.
minus
This function and x - y are equivalent.
mldivide
Return the matrix left division of X and Y.
mpower
Return the matrix power operation of X raised to the Y power.
mrdivide
Return the matrix right division of X and Y.
mtimes
Return the matrix multiplication product of inputs.
plus
This function and x + y are equivalent.
power
Return the element-by-element operation of X raised to the Y power.
rdivide
Return the element-by-element right division of X and Y.
times
Return the element-by-element multiplication product of inputs.
transpose
Return the transpose of X.
uminus
This function and - x are equivalent.
uplus
This function and + x are equivalent.

Comparison Operators

eq
Return true if the two inputs are equal.
ge
This function is equivalent to 'x >= y'.
gt
This function is equivalent to 'x > y'.
isequal
Return true if all of X1, X2, ...
isequaln
Return true if all of X1, X2, ...
le
This function is equivalent to 'x <= y'.
lt
This function is equivalent to 'x < y'.
ne
Return true if the two inputs are not equal.

Boolean Expressions

and
Return the logical AND of X and Y.
not
Return the logical NOT of X.
or
Return the logical OR of X and Y.
do_braindead_shortcircuit_evaluation
Query or set the internal variable that controls whether Octave will do short-circuit evaluation of '|' and '&' operators inside the conditions of if or while statements.
merge
Merge elements of TRUE_VAL and FALSE_VAL, depending on the value of MASK.

General

eval
Parse the string TRY and evaluate it as if it were an Octave program.
evalc
Parse and evaluate the string TRY as if it were an Octave program, while capturing the output into the return variable S.

Calling a Function by its Name

feval
Evaluate the function named NAME.
run
Run SCRIPT in the current workspace.

Evaluation in a Different Context

evalin
Like 'eval', except that the expressions are evaluated in the context CONTEXT, which may be either "caller" or "base".
assignin
Assign VALUE to VARNAME in context CONTEXT, which may be either "base" or "caller".

Defining Functions

nargin
Report the number of input arguments to a function.
inputname
Return the name of the N-th argument to the calling function.
silent_functions
Query or set the internal variable that controls whether internal output from a function is suppressed.

Multiple Return Values

nthargout
Return the Nth output argument of the function specified by the function handle or string FUNC.
nargout
Report the number of output arguments from a function.
narginchk
Check for correct number of input arguments.
nargoutchk
Check for correct number of output arguments.
validatestring
Verify that STR is an element, or substring of an element, in STRARRAY.
validateattributes
Check validity of input argument.
inputParser
Not documented

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.

Ignoring Arguments

isargout
Within a function, return a logical value indicating whether the argument K will be assigned to a variable on output.

Variable-length Return Lists

deal
Copy the input parameters into the corresponding output parameters.

Function Files

edit
Edit the named function, or change editor settings.
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 named directories to the function search path.
genpath
Return a path constructed from DIR and all its subdirectories.
rmpath
Remove DIR1, ...
savepath
Save the unique portion of the current function search path that is not set during Octave's initialization process to FILE.
path
Modify or display Octave's load path.
pathdef
Return the default path for Octave.
pathsep
Query or set the 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 its initial state at startup.
command_line_path
Return the command line path variable.
dir_in_loadpath
Return the full name of the path element matching DIR.
localfunctions
Return a list of all local functions, i.e., subfunctions, within the current file.
builtin
Call the base function F even if F is overloaded to another 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 FCN.
mislocked
Return true if the named function FCN is locked.

Script Files

source
Parse and execute the contents of FILE.
publish
Generate reports from Octave script files in several output formats.
grabcode
Grab by the 'publish' function generated HTML reports from Octave script files.

Function Handles, Anonymous Functions, Inline Functions

is_function_handle
Return true if X is a function handle.
functions
Return a structure 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.
symvar
Identify the symbolic variable names in the string STR.

Handling Errors

error
Display an error message and stop m-file execution.
print_usage
Print the usage message for the function NAME.
beep
Produce a beep from the speaker (or visual bell).
beep_on_error
Query or set the internal variable that controls whether Octave will try to ring the terminal bell before printing an error message.
lasterror
Query or set the last error message structure.
lasterr
Query or set the last error message.
error_ids
'Octave:invalid-context' Indicates the error was generated by an operation that cannot be executed in the scope from which it was called.
rethrow
Reissue a previous error as defined by ERR.
errno
Return the current value of the system-dependent variable errno, set its value to VAL and return the previous value, or return the named error code given NAME as a character string, or -1 if NAME is n
errno_list
Return a structure containing the system-dependent errno values.
onCleanup
Create a special object that executes a given function upon destruction.

Handling Warnings

warning
Display a warning message or control the behavior of Octave's warning system.
lastwarn
Query or set the last warning message.
warning_ids
'Octave:abbreviated-property-match' By default, the 'Octave:abbreviated-property-match' warning is enabled.

Entering Debug Mode

debug_on_interrupt
Query or set the internal variable that controls whether Octave will try to enter debugging mode when it receives an interrupt signal (typically generated with 'C-c').
debug_on_warning
Query or set the internal variable that controls whether Octave will try to enter the debugger when a warning is encountered.
debug_on_error
Query or set the internal variable that controls whether Octave will try to enter the debugger when an error is encountered.

Leaving Debug Mode

dbcont
Leave command-line debugging mode and continue code execution normally.
dbquit
Quit debugging mode immediately without further code execution and return to the Octave prompt.

Breakpoints

dbstop
Set breakpoints for the built-in debugger.
dbstatus
Report the location of active breakpoints.
dbclear
Delete a breakpoint at line number LINE in the function FUNC.
keyboard
Stop m-file execution and enter debug mode.

Debug Mode

dbwhere
In debugging mode, report the current file and line number where execution is stopped.
dbtype
Display a script file with line numbers.
dblist
In debugging mode, list N lines of the function being debugged centered around the current line to be executed.
isdebugmode
Return true if in debugging mode, otherwise false.
dbstep
In debugging mode, execute the next N lines of code.

Call Stack

dbstack
Display or return current debugging function stack information.
dbup
In debugging mode, move up the execution stack N frames.
dbdown
In debugging mode, move down the execution stack N frames.

Profiling

profile
Control the built-in profiler.
profshow
Display flat per-function profiler results.
profexport
Export profiler data as HTML.
profexplore
Interactively explore hierarchical profiler output.

Basic Input and Output

disp
Display the value of X.
list_in_columns
Return a string containing the elements of ARG listed in columns with an overall maximum width of WIDTH and optional prefix PREFIX.
terminal_size
Return a two-element row vector containing the current size of the terminal window in characters (rows and columns).
format
Reset or specify the format of the output produced by 'disp' and Octave's normal echoing mechanism.
more
Turn output pagination on or off.
PAGER
Query or set the internal variable that specifies the program to use to display terminal output on your system.
PAGER_FLAGS
Query or set the internal variable that specifies the options to pass to the pager.
page_screen_output
Query or set the internal variable that controls whether output intended for the terminal window that is longer than one page is sent through a pager.
page_output_immediately
Query or set the internal variable that controls whether Octave sends output to the pager as soon as it is available.
fflush
Flush output to file descriptor FID.
input
Print PROMPT and wait for user input.
menu
Display a menu with heading TITLE and options OPT1, ..., and wait for user input.
yes_or_no
Ask the user a yes-or-no question.
kbhit
Read a single keystroke from the keyboard.
save
Save the named variables V1, V2, ..., in the file FILE.
save_default_options
Query or set the internal variable that specifies the default options for the 'save' command, and defines the default format.
save_precision
Query or set the internal variable that specifies the number of digits to keep when saving data in text format.
save_header_format_string
Query or set the internal variable that specifies the format string used for the comment line written at the beginning of text-format data files saved by Octave.
load
Load the named variables V1, V2, ..., from the file FILE.
fileread
Read the contents of FILENAME and return it as a string.
native_float_format
Return the native floating point format as a string.
fdisp
Display the value of X on the stream FID.
dlmwrite
Write the numeric matrix M to the text file FILE using a delimiter.
dlmread
Read numeric data from the text file FILE which uses the delimiter SEP between data values.
csvwrite
Write the numeric matrix X to the file FILENAME in comma-separated-value (CSV) format.
csvread
Read the comma-separated-value (CSV) file FILENAME into the matrix X.
textread
Read data from a text file.
textscan
Read data from a text file or string.
importdata
Import data from the file FNAME.
crash_dumps_octave_core
Query or set the internal variable that controls whether Octave tries to save all current variables to the file 'octave-workspace' if it crashes or receives a hangup, terminate or similar signal.
sighup_dumps_octave_core
Query or set the internal variable that controls whether Octave tries to save all current variables to the file 'octave-workspace' if it receives a hangup signal.
sigterm_dumps_octave_core
Query or set the internal variable that controls whether Octave tries to save all current variables to the file 'octave-workspace' if it receives a terminate signal.
octave_core_file_options
Query or set the internal variable that specifies the options used for saving the workspace data if Octave aborts.
octave_core_file_limit
Query or set the internal variable that specifies the maximum amount of memory (in kilobytes) of the top-level workspace that Octave will attempt to save when writing data to the crash dump file (the
octave_core_file_name
Query or set the internal variable that specifies the name of the file used for saving data from the top-level workspace if Octave aborts.

C-Style I/O Functions

stdin
Return the numeric value corresponding to the standard input stream.
stdout
Return the numeric value corresponding to the standard output stream.
stderr
Return the numeric value corresponding to the standard error stream.
fopen
Open a file for low-level I/O or query open files and file descriptors.
fclose
Close the file specified by the file descriptor FID.
is_valid_file_id
Return true if FID refers to an open file.
fputs
Write the string STRING to the file with file descriptor FID.
puts
Write a string to the standard output with no formatting.
fgetl
Read characters from a file, stopping after a newline, or EOF, or LEN characters have been read.
fgets
Read characters from a file, stopping after a newline, or EOF, or LEN characters have been read.
fskipl
Read and skip COUNT lines from the file specified by the file descriptor FID.
printf
Print optional arguments under the control of the template string TEMPLATE to the stream 'stdout' and return the number of characters printed.
fprintf
This function is equivalent to 'printf', except that the output is written to the file descriptor FID instead of 'stdout'.
sprintf
This is like 'printf', except that the output is returned as a string.
fscanf
In the first form, read from FID according to TEMPLATE, returning the result in the matrix VAL.
scanf
This is equivalent to calling 'fscanf' with FID = 'stdin'.
sscanf
This is like 'fscanf', except that the characters are taken from the string STRING instead of from a stream.
fread
Read binary data from the file specified by the file descriptor FID.
fwrite
Write data in binary form to the file specified by the file descriptor FID, returning the number of values COUNT successfully written to the file.
mkstemp
Return the file descriptor FID corresponding to a new temporary file with a unique name created from TEMPLATE.
tmpfile
Return the file ID corresponding to a new temporary file with a unique name.
tempname
Return a unique temporary filename as a string.
tempdir
Return the name of the host system's directory for temporary files.
P_tmpdir
Return the name of the host system's *default* directory for temporary files.
feof
Return 1 if an end-of-file condition has been encountered for the file specified by file descriptor FID and 0 otherwise.
ferror
Query the error status of the stream specified by file descriptor FID
fclear
Clear the stream state for the file specified by the file descriptor FID.
freport
Print a list of which files have been opened, and whether they are open for reading, writing, or both.
ftell
Return the position of the file pointer as the number of characters from the beginning of the file specified by file descriptor FID.
fseek
Set the file pointer to the location OFFSET within the file FID.
SEEK_SET
Return the numerical value to pass to 'fseek' to perform one of the following actions:
frewind
Move the file pointer to the beginning of the file specified by file descriptor FID.

High-Level Plotting

plot
Produce 2-D plots.
plotyy
Plot two sets of data with independent y-axes and a common x-axis.
semilogx
Produce a 2-D plot using a logarithmic scale for the x-axis.
semilogy
Produce a 2-D plot using a logarithmic scale for the y-axis.
loglog
Produce a 2-D plot using logarithmic scales for both axes.
bar
Produce a bar graph from two vectors of X-Y data.
barh
Produce a horizontal bar graph from two vectors of X-Y data.
hist
Produce histogram counts or plots.
stemleaf
Compute and display a stem and leaf plot of the vector X.
printd
Convert any object acceptable to 'disp' into the format selected by the suffix of FILENAME.
stairs
Produce a stairstep plot.
stem
Plot a 2-D stem graph.
stem3
Plot a 3-D stem graph.
scatter
Draw a 2-D scatter plot.
plotmatrix
Scatter plot of the columns of one matrix against another.
pareto
Draw a Pareto chart.
rose
Plot an angular histogram.
contour
Create a 2-D contour plot.
contourf
Create a 2-D contour plot with filled intervals.
contourc
Compute contour lines (isolines of constant Z value).
contour3
Create a 3-D contour plot.
errorbar
Create a 2-D plot with errorbars.
semilogxerr
Produce 2-D plots using a logarithmic scale for the x-axis and errorbars at each data point.
semilogyerr
Produce 2-D plots using a logarithmic scale for the y-axis and errorbars at each data point.
loglogerr
Produce 2-D plots on a double logarithm axis with errorbars.
polar
Create a 2-D plot from polar coordinates THETA and RHO.
pie
Plot a 2-D pie chart.
pie3
Plot a 3-D pie chart.
quiver
Plot a 2-D vector field with arrows.
quiver3
Plot a 3-D vector field with arrows.
compass
Plot the '(U, V)' components of a vector field emanating from the origin of a polar plot.
feather
Plot the '(U, V)' components of a vector field emanating from equidistant points on the x-axis.
pcolor
Produce a 2-D density plot.
area
Area plot of the columns of Y.
fill
Create one or more filled 2-D polygons.
comet
Produce a simple comet style animation along the trajectory provided by the input coordinate vectors (X, Y).
comet3
Produce a simple comet style animation along the trajectory provided by the input coordinate vectors (X, Y, Z).
frame2im
Convert movie frame to indexed image.
im2frame
Convert image to movie frame.
axis
Set axis limits and appearance.
caxis
Query or set color axis limits for plots.
xlim
Query or set the limits of the x-axis for the current plot.
fplot
Plot a function FN within the range defined by LIMITS.
ezplot
Plot the 2-D curve defined by the function F.
ezcontour
Plot the contour lines of a function.
ezcontourf
Plot the filled contour lines of a function.
ezpolar
Plot a 2-D function in polar coordinates.
rectangle
Draw a rectangular patch defined by POS and CURV.
mesh
Plot a 3-D wireframe mesh.
meshc
Plot a 3-D wireframe mesh with underlying contour lines.
meshz
Plot a 3-D wireframe mesh with a surrounding curtain.
hidden
Control mesh hidden line removal.
surf
Plot a 3-D surface mesh.
surfc
Plot a 3-D surface mesh with underlying contour lines.
surfl
Plot a 3-D surface using shading based on various lighting models.
surfnorm
Find the vectors normal to a meshgridded surface.
isosurface
Calculate isosurface of 3-D volume data.
isonormals
Calculate normals to an isosurface.
isocaps
Create end-caps for isosurfaces of 3-D data.
isocolors
Compute isosurface colors.
smooth3
Smooth values of 3-dimensional matrix DATA.
reducevolume
Reduce the volume of the dataset in V according to the values in R.
reducepatch
Reduce the number of faces and vertices in a patch object while retaining the overall shape of the patch.
shrinkfaces
Reduce the size of faces in a patch by the shrink factor SF.
diffuse
Calculate the diffuse reflection strength of a surface defined by the normal vector elements SX, SY, SZ.
specular
Calculate the specular reflection strength of a surface defined by the normal vector elements SX, SY, SZ using Phong's approximation.
lighting
Set the lighting of patch or surface graphic objects.
material
Set reflectance properties for the lighting of surfaces and patches.
camlight
Add a light object to a figure using a simple interface.
meshgrid
Given vectors of X and Y coordinates, return matrices XX and YY corresponding to a full 2-D grid.
ndgrid
Given n vectors X1, ..., Xn, 'ndgrid' returns n arrays of dimension n.
plot3
Produce 3-D plots.
view
Query or set the viewpoint for the current axes.
slice
Plot slices of 3-D data/scalar fields.
ribbon
Draw a ribbon plot for the columns of Y vs.
shading
Set the shading of patch or surface graphic objects.
scatter3
Draw a 3-D scatter plot.
waterfall
Plot a 3-D waterfall plot.
daspect
Query or set the data aspect ratio of the current axes.
pbaspect
Query or set the plot box aspect ratio of the current axes.
ezplot3
Plot a parametrically defined curve in three dimensions.
ezmesh
Plot the mesh defined by a function.
ezmeshc
Plot the mesh and contour lines defined by a function.
ezsurf
Plot the surface defined by a function.
ezsurfc
Plot the surface and contour lines defined by a function.
cylinder
Plot a 3-D unit cylinder.
sphere
Plot a 3-D unit sphere.
ellipsoid
Plot a 3-D ellipsoid.
title
Specify the string used as a title for the current axis.
legend
Display a legend for the current axes using the specified strings as labels.
text
Create a text object with text STRING at position X, Y, (Z) on the current axes.
xlabel
Specify the string used to label the x-axis of the current axis.
clabel
Add labels to the contours of a contour plot.
box
Control display of the axis border.
grid
Control the display of plot grid lines.
colorbar
Add a colorbar to the current axes.
annotation
Draw annotations to emphasize parts of a figure.
subplot
Set up a plot grid with ROWS by COLS subwindows and set the current axes for plotting ('gca') to the location given by INDEX.
figure
Create a new figure window for plotting.
pan
Control the interactive panning mode of a figure in the GUI.
rotate
Rotate the plot object H through ALPHA degrees around the line with direction DIR and origin ORIGIN.
rotate3d
Control the interactive 3-D rotation mode of a figure in the GUI.
zoom
Zoom the current axes object or control the interactive zoom mode of a figure in the GUI.
drawnow
Update figure windows and their children.
refresh
Refresh a figure, forcing it to be redrawn.
newplot
Prepare graphics engine to produce a new plot.
hold
Toggle or set the "hold" state of the plotting engine which determines whether new graphic objects are added to the plot or replace the existing objects.
ishold
Return true if the next plot will be added to the current plot, or false if the plot device will be cleared before drawing the next plot.
clf
Clear the current figure window.
cla
Clear the current axes.
shg
Show the graph window.
delete
Delete the named file or graphics handle.
close
Close figure window(s).
closereq
Close the current figure and delete all graphics objects associated with it.
print
Print a plot, or save it to a file.
saveas
Save graphic object H to the file FILENAME in graphic format FMT.
orient
Query or set the print orientation for figure HFIG.
hgsave
Save the graphics handle H to the file FILENAME in the format FMT.
hgload
Load the graphics object in FILENAME into the graphics handle H.
ginput
Return the position and type of mouse button clicks and/or key strokes in the current figure window.
waitforbuttonpress
Wait for mouse click or key press over the current figure window.
gtext
Place text on the current figure using the mouse.
sombrero
Plot the familiar 3-D sombrero function.
peaks
Plot a function with lots of local maxima and minima.

Graphics Data Structures

isprop
Return true if PROP is a property of the object OBJ.
axes
Create an axes object and return a handle to it, or set the current axes to HAX.
line
Create line object from X and Y (and possibly Z) and insert in the current axes.
patch
Create patch object in the current axes with vertices at locations (X, Y) and of color C.
surface
Create a surface graphic object given matrices X and Y from 'meshgrid' and a matrix of values Z corresponding to the X and Y coordinates of the surface.
light
Create a light object in the current axes or for axes HAX.
ishandle
Return true if H is a graphics handle and false otherwise.
ishghandle
Return true if H is a graphics handle (of type TYPE) and false otherwise.
isaxes
Return true if H is an axes graphics handle and false otherwise.
isfigure
Return true if H is a figure graphics handle and false otherwise.
gcf
Return a handle to the current figure.
gca
Return a handle to the current axis object.
gco
Return a handle to the current object of the current figure, or a handle to the current object of the figure with handle FIG.
get
Return the value of the named property P from the graphics handle H.
set
Set named property values for the graphics handle (or vector of graphics handles) H.
ancestor
Return the first ancestor of handle object H whose type matches TYPE, where TYPE is a character string.
allchild
Find all children, including hidden children, of a graphics object.
findfigs
Find all visible figures that are currently off the screen and move them onto the screen.
hdl2struct
Return a structure, S, whose fields describe the properties of the object, and its children, associated with the handle, H.
struct2hdl
Construct a graphics handle object H from the structure S.
copyobj
Construct a copy of the graphic objects associated with the handles HORIG and return new handles HNEW to the new objects.
findobj
Find graphics object with specified property values.
findall
Find graphics object, including hidden ones, with specified property values.
reset
Reset the properties of the graphic object H to their default values.

Advanced Plotting

colstyle
Parse LINESPEC and return the line style, color, and markers given.
gcbo
Return a handle to the object whose callback is currently executing.
gcbf
Return a handle to the figure containing the object whose callback is currently executing.
setappdata
Set the application data NAME to VALUE for the graphics object with handle H.
getappdata
Return the VALUE of the application data NAME for the graphics object with handle H.
rmappdata
Delete the application data NAME from the graphics object with handle H.
isappdata
Return true if the named application data, NAME, exists for the graphics object with handle H.
hggroup
Create handle graphics group object with axes parent HAX.
addproperty
Create a new property named NAME in graphics object H.
addlistener
Register FCN as listener for the property PROP of the graphics object H.
dellistener
Remove the registration of FCN as a listener for the property PROP of the graphics object H.
linkprop
Link graphic object properties, such that a change in one is propagated to the others.
linkaxes
Link the axis limits of 2-D plots such that a change in one is propagated to the others.
refreshdata
Evaluate any 'datasource' properties of the current figure and update the plot if the corresponding data has changed.
graphics_toolkit
Query or set the default graphics toolkit which is assigned to new figures.
available_graphics_toolkits
Return a cell array of registered graphics toolkits.
loaded_graphics_toolkits
Return a cell array of the currently loaded graphics toolkits.
register_graphics_toolkit
List TOOLKIT as an available graphics toolkit.
gnuplot_binary
Query or set the name of the program invoked by the plot command when the graphics toolkit is set to "gnuplot".

Finding Elements and Checking Conditions

any
For a vector argument, return true (logical 1) if any element of the vector is nonzero.
all
For a vector argument, return true (logical 1) if all elements of the vector are nonzero.
xor
Return the "exclusive or" of X and Y.
diff
If X is a vector of length n, 'diff (X)' is the vector of first differences X(2) - X(1), ..., X(n) - X(n-1).
isinf
Return a logical array which is true where the elements of X are infinite and false where they are not.
isnan
Return a logical array which is true where the elements of X are NaN values and false where they are not.
isfinite
Return a logical array which is true where the elements of X are finite values and false where they are not.
common_size
Determine if all input arguments are either scalar or of common size.
find
Return a vector of indices of nonzero elements of a matrix, as a row if X is a row vector or as a column otherwise.
lookup
Lookup values in a sorted table.

Rearranging Matrices

fliplr
Flip array left to right.
flipud
Flip array upside down.
flip
Flip array across dimension DIM.
rot90
Rotate array by 90 degree increments.
rotdim
Return a copy of X with the elements rotated counterclockwise in 90-degree increments.
cat
Return the concatenation of N-D array objects, ARRAY1, ARRAY2, ..., ARRAYN along dimension DIM.
horzcat
Return the horizontal concatenation of N-D array objects, ARRAY1, ARRAY2, ..., ARRAYN along dimension 2.
vertcat
Return the vertical concatenation of N-D array objects, ARRAY1, ARRAY2, ..., ARRAYN along dimension 1.
permute
Return the generalized transpose for an N-D array object A.
ipermute
The inverse of the 'permute' function.
reshape
Return a matrix with the specified dimensions (M, N, ...) whose elements are taken from the matrix A.
resize
Resize X cutting off elements as necessary.
circshift
Circularly shift the values of the array X.
shift
If X is a vector, perform a circular shift of length B of the elements of X.
shiftdim
Shift the dimensions of X by N, where N must be an integer scalar.
sort
Return a copy of X with the elements arranged in increasing order.
sortrows
Sort the rows of the matrix A according to the order of the columns specified in C.
issorted
Return true if the array is sorted according to MODE, which may be either "ascending", "descending", or "either".
nth_element
Select the n-th smallest element of a vector, using the ordering defined by 'sort'.
tril
Return a new matrix formed by extracting the lower ('tril') or upper ('triu') triangular part of the matrix A, and setting all other elements to zero.
vec
Return the vector obtained by stacking the columns of the matrix X one above the other.
vech
Return the vector obtained by eliminating all superdiagonal elements of the square matrix X and stacking the result one column above the other.
prepad
Prepend the scalar value C to the vector X until it is of length L.
postpad
Append the scalar value C to the vector X until it is of length L.
diag
Return a diagonal matrix with vector V on diagonal K.
blkdiag
Build a block diagonal matrix from A, B, C, ...

Special Utility Matrices

eye
Return an identity matrix.
ones
Return a matrix or N-dimensional array whose elements are all 1.
zeros
Return a matrix or N-dimensional array whose elements are all 0.
repmat
Repeat matrix or N-D array.
repelems
Construct a vector of repeated elements from X.
linspace
Return a row vector with N linearly spaced elements between BASE and LIMIT.
logspace
Return a row vector with N elements logarithmically spaced from 10^A to 10^B.
rand
Return a matrix with random elements uniformly distributed on the interval (0, 1).
randi
Return random integers in the range 1:IMAX.
randn
Return a matrix with normally distributed random elements having zero mean and variance one.
rande
Return a matrix with exponentially distributed random elements.
randp
Return a matrix with Poisson distributed random elements with mean value parameter given by the first argument, L.
randg
Return a matrix with 'gamma (A,1)' distributed random elements.
randperm
Return a row vector containing a random permutation of '1:N'.

Famous Matrices

gallery
Create interesting matrices for testing.
hadamard
Construct a Hadamard matrix (Hn) of size N-by-N.
hankel
Return the Hankel matrix constructed from the first column C, and (optionally) the last row R.
hilb
Return the Hilbert matrix of order N.
invhilb
Return the inverse of the Hilbert matrix of order N.
magic
Create an N-by-N magic square.
pascal
Return the Pascal matrix of order N if 'T = 0'.
rosser
Return the Rosser matrix.
toeplitz
Return the Toeplitz matrix constructed from the first column C, and (optionally) the first row R.
vander
Return the Vandermonde matrix whose next to last column is C.
wilkinson
Return the Wilkinson matrix of order N.

Exponents and Logarithms

exp
Compute 'e^x' for each element of X.
expm1
Compute 'exp (X) - 1' accurately in the neighborhood of zero.
log
Compute the natural logarithm, 'ln (X)', for each element of X.
reallog
Return the real-valued natural logarithm of each element of X.
log1p
Compute 'log (1 + X)' accurately in the neighborhood of zero.
log10
Compute the base-10 logarithm of each element of X.
log2
Compute the base-2 logarithm of each element of X.
pow2
With one input argument, compute 2 .^ x for each element of X.
nextpow2
Compute the exponent for the smallest power of two larger than the input.
realpow
Compute the real-valued, element-by-element power operator.
sqrt
Compute the square root of each element of X.
realsqrt
Return the real-valued square root of each element of X.
cbrt
Compute the real cube root of each element of X.
nthroot
Compute the real (non-complex) N-th root of X.

Complex Arithmetic

abs
Compute the magnitude of Z.
arg
Compute the argument, i.e., angle of Z.
conj
Return the complex conjugate of Z.
cplxpair
Sort the numbers Z into complex conjugate pairs ordered by increasing real part.
imag
Return the imaginary part of Z as a real number.
real
Return the real part of Z.

Trigonometry

deg2rad
Convert degrees to radians.
rad2deg
Convert radians to degrees.
sin
Compute the sine for each element of X in radians.
cos
Compute the cosine for each element of X in radians.
tan
Compute the tangent for each element of X in radians.
sec
Compute the secant for each element of X in radians.
csc
Compute the cosecant for each element of X in radians.
cot
Compute the cotangent for each element of X in radians.
asin
Compute the inverse sine in radians for each element of X.
acos
Compute the inverse cosine in radians for each element of X.
atan
Compute the inverse tangent in radians for each element of X.
asec
Compute the inverse secant in radians for each element of X.
acsc
Compute the inverse cosecant in radians for each element of X.
acot
Compute the inverse cotangent in radians for each element of X.
sinh
Compute the hyperbolic sine for each element of X.
cosh
Compute the hyperbolic cosine for each element of X.
tanh
Compute hyperbolic tangent for each element of X.
sech
Compute the hyperbolic secant of each element of X.
csch
Compute the hyperbolic cosecant of each element of X.
coth
Compute the hyperbolic cotangent of each element of X.
asinh
Compute the inverse hyperbolic sine for each element of X.
acosh
Compute the inverse hyperbolic cosine for each element of X.
atanh
Compute the inverse hyperbolic tangent for each element of X.
asech
Compute the inverse hyperbolic secant of each element of X.
acsch
Compute the inverse hyperbolic cosecant of each element of X.
acoth
Compute the inverse hyperbolic cotangent of each element of X.
atan2
Compute atan (Y / X) for corresponding elements of Y and X.
sind
Compute the sine for each element of X in degrees.
cosd
Compute the cosine for each element of X in degrees.
tand
Compute the tangent for each element of X in degrees.
secd
Compute the secant for each element of X in degrees.
cscd
Compute the cosecant for each element of X in degrees.
cotd
Compute the cotangent for each element of X in degrees.
asind
Compute the inverse sine in degrees for each element of X.
acosd
Compute the inverse cosine in degrees for each element of X.
atand
Compute the inverse tangent in degrees for each element of X.
atan2d
Compute atan2 (Y / X) in degrees for corresponding elements from Y and X.
asecd
Compute the inverse secant in degrees for each element of X.
acscd
Compute the inverse cosecant in degrees for each element of X.
acotd
Compute the inverse cotangent in degrees for each element of X.

Sums and Products

sum
Sum of elements along dimension DIM.
prod
Product of elements along dimension DIM.
cumsum
Cumulative sum of elements along dimension DIM.
cumprod
Cumulative product of elements along dimension DIM.
sumsq
Sum of squares of elements along dimension DIM.

Utility Functions

ceil
Return the smallest integer not less than X.
fix
Truncate fractional portion of X and return the integer portion.
floor
Return the largest integer not greater than X.
round
Return the integer nearest to X.
roundb
Return the integer nearest to X.
max
Find maximum values in the array X.
min
Find minimum values in the array X.
cummax
Return the cumulative maximum values along dimension DIM.
cummin
Return the cumulative minimum values along dimension DIM.
hypot
Compute the element-by-element square root of the sum of the squares of X and Y.
gradient
Calculate the gradient of sampled data or a function.
dot
Compute the dot product of two vectors.
cross
Compute the vector cross product of two 3-dimensional vectors X and Y.
divergence
Calculate divergence of a vector field given by the arrays FX, FY, and FZ or FX, FY respectively.
curl
Calculate curl of vector field given by the arrays FX, FY, and FZ or FX, FY respectively.
del2
Calculate the discrete Laplace operator.
factorial
Return the factorial of N where N is a real non-negative integer.
factor
Return the prime factorization of Q.
gcd
Compute the greatest common divisor of A1, A2, ....
lcm
Compute the least common multiple of X and Y, or of the list of all arguments.
chop
Truncate elements of X to a length of NDIGITS such that the resulting numbers are exactly divisible by BASE.
rem
Return the remainder of the division 'X / Y'.
mod
Compute the modulo of X and Y.
primes
Return all primes up to N.
list_primes
List the first N primes.
sign
Compute the "signum" function.
signbit
Return logical true if the value of X has its sign bit set and false otherwise.

Special Functions

airy
Compute Airy functions of the first and second kind, and their derivatives.
besselj
Compute Bessel or Hankel functions of various kinds:
beta
Compute the Beta function for real inputs A and B.
betainc
Compute the regularized incomplete Beta function.
betaincinv
Compute the inverse of the incomplete Beta function.
betaln
Compute the natural logarithm of the Beta function for real inputs A and B.
bincoeff
Return the binomial coefficient of N and K, defined as
commutation_matrix
Return the commutation matrix K(m,n) which is the unique M*N by M*N matrix such that K(m,n) * vec(A) = vec(A') for all m by n matrices A.
duplication_matrix
Return the duplication matrix Dn which is the unique n^2 by n*(n+1)/2 matrix such that Dn vech (A) = vec (A) for all symmetric n by n matrices A.
dawson
Compute the Dawson (scaled imaginary error) function.
ellipj
Compute the Jacobi elliptic functions SN, CN, and DN of complex argument U and real parameter M.
ellipke
Compute complete elliptic integrals of the first K(M) and second E(M) kind.
erf
Compute the error function.
erfc
Compute the complementary error function.
erfcx
Compute the scaled complementary error function.
erfi
Compute the imaginary error function.
erfinv
Compute the inverse error function.
erfcinv
Compute the inverse complementary error function.
expint
Compute the exponential integral:
gamma
Compute the Gamma function.
gammainc
Compute the normalized incomplete gamma function.
legendre
Compute the associated Legendre function of degree N and order M = 0 ...
lgamma
Return the natural logarithm of the gamma function of X.
psi
Compute the psi (polygamma) function.

Rational Approximations

rat
Find a rational approximation to X within the tolerance defined by TOL using a continued fraction expansion.
rats
Convert X into a rational approximation represented as a string.

Coordinate Transformations

cart2pol
Transform Cartesian coordinates to polar or cylindrical coordinates.
pol2cart
Transform polar or cylindrical coordinates to Cartesian coordinates.
cart2sph
Transform Cartesian coordinates to spherical coordinates.
sph2cart
Transform spherical coordinates to Cartesian coordinates.

Mathematical Constants

e
Return a scalar, matrix, or N-dimensional array whose elements are all equal to the base of natural logarithms.
pi
Return a scalar, matrix, or N-dimensional array whose elements are all equal to the ratio of the circumference of a circle to its diameter.
I
Return a scalar, matrix, or N-dimensional array whose elements are all equal to the pure imaginary unit, defined as 'sqrt (-1)'.
Inf
Return a scalar, matrix or N-dimensional array whose elements are all equal to the IEEE representation for positive infinity.
NaN
Return a scalar, matrix, or N-dimensional array whose elements are all equal to the IEEE symbol NaN (Not a Number).
eps
Return a scalar, matrix or N-dimensional array whose elements are all eps, the machine precision.
realmax
Return a scalar, matrix, or N-dimensional array whose elements are all equal to the largest floating point number that is representable.
realmin
Return a scalar, matrix, or N-dimensional array whose elements are all equal to the smallest normalized floating point number that is representable.

Basic Matrix Functions

balance
Balance the matrix A to reduce numerical errors in future calculations.
bandwidth
Compute the bandwidth of A.
cond
Compute the P-norm condition number of a matrix with respect to inversion.
condeig
Compute condition numbers of a matrix with respect to eigenvalues.
det
Compute the determinant of A.
eig
Compute the right eigenvalues(V) and optionally the eigenvectors(lambda) and the left eigenvalues(W) of a matrix or a pair of matrices.
givens
Compute the Givens rotation matrix G.
planerot
Given a two-element column vector, return the 2 by 2 orthogonal matrix G such that 'Y = G * X' and 'Y(2) = 0'.
inv
Compute the inverse of the square matrix A.
linsolve
Solve the linear system 'A*x = b'.
matrix_type
Identify the matrix type or mark a matrix as a particular type.
norm
Compute the p-norm of the matrix A.
null
Return an orthonormal basis of the null space of A.
orth
Return an orthonormal basis of the range space of A.
mgorth
Orthogonalize a given column vector X with respect to a set of orthonormal vectors comprising the columns of V using the modified Gram-Schmidt method.
pinv
Return the pseudoinverse of X.
rank
Compute the rank of matrix A, using the singular value decomposition.
rcond
Compute the 1-norm estimate of the reciprocal condition number as returned by LAPACK.
trace
Compute the trace of A, the sum of the elements along the main diagonal.
rref
Return the reduced row echelon form of A.

Matrix Factorizations

chol
Compute the upper Cholesky factor, R, of the real symmetric or complex Hermitian positive definite matrix A.
cholinv
Compute the inverse of the symmetric positive definite matrix A using the Cholesky factorization.
chol2inv
Invert a symmetric, positive definite square matrix from its Cholesky decomposition, U.
cholupdate
Update or downdate a Cholesky factorization.
cholinsert
Given a Cholesky factorization of a real symmetric or complex Hermitian positive definite matrix A = R'*R, R upper triangular, return the Cholesky factorization of A1, where A1(p,p) = A, A1(:,j) = A1(
choldelete
Given a Cholesky factorization of a real symmetric or complex Hermitian positive definite matrix A = R'*R, R upper triangular, return the Cholesky factorization of A(p,p), where p = [1:j-1,j+1:n+1].
cholshift
Given a Cholesky factorization of a real symmetric or complex Hermitian positive definite matrix A = R'*R, R upper triangular, return the Cholesky factorization of A(p,p), where p is the permutation '
hess
Compute the Hessenberg decomposition of the matrix A.
lu
Compute the LU decomposition of A.
luupdate
Given an LU factorization of a real or complex matrix A = L*U, L lower unit trapezoidal and U upper trapezoidal, return the LU factorization of A + X*Y.', where X and Y are column vectors (rank-1 upda
qr
Compute the QR factorization of A, using standard LAPACK subroutines.
qrupdate
Given a QR factorization of a real or complex matrix A = Q*R, Q unitary and R upper trapezoidal, return the QR factorization of A + U*V', where U and V are column vectors (rank-1 update) or matrices w
qrinsert
Given a QR factorization of a real or complex matrix A = Q*R, Q unitary and R upper trapezoidal, return the QR factorization of [A(:,1:j-1) x A(:,j:n)], where U is a column vector to be inserted into
qrdelete
Given a QR factorization of a real or complex matrix A = Q*R, Q unitary and R upper trapezoidal, return the QR factorization of [A(:,1:j-1), U, A(:,j:n)], where U is a column vector to be inserted int
qrshift
Given a QR factorization of a real or complex matrix A = Q*R, Q unitary and R upper trapezoidal, return the QR factorization of A(:,p), where p is the permutation 'p = [1:i-1, shift(i:j, 1), j+1:n]' i
qz
QZ decomposition of the generalized eigenvalue problem (A x = s B x).
qzhess
Compute the Hessenberg-triangular decomposition of the matrix pencil '(A, B)', returning 'AA = Q * A * Z', 'BB = Q * B * Z', with Q and Z orthogonal.
schur
Compute the Schur decomposition of A.
rsf2csf
Convert a real, upper quasi-triangular Schur form TR to a complex, upper triangular Schur form T.
ordschur
Reorders the real Schur factorization (U,S) obtained with the 'schur' function, so that selected eigenvalues appear in the upper left diagonal blocks of the quasi triangular Schur matrix.
subspace
Determine the largest principal angle between two subspaces spanned by the columns of matrices A and B.
svd
Compute the singular value decomposition of A
svd_driver
Query or set the underlying LAPACK driver used by 'svd'.
housh
Compute Householder reflection vector HOUSV to reflect X to be the j-th column of identity, i.e.,
krylov
Construct an orthogonal basis U of block Krylov subspace

Functions of a Matrix

expm
Return the exponential of a matrix.
logm
Compute the matrix logarithm of the square matrix A.
sqrtm
Compute the matrix square root of the square matrix A.
kron
Form the Kronecker product of two or more matrices.
blkmm
Compute products of matrix blocks.
sylvester
Solve the Sylvester equation

Specialized Solvers

bicg
Solve 'A x = b' using the Bi-conjugate gradient iterative method.
bicgstab
Solve 'A x = b' using the stabilizied Bi-conjugate gradient iterative method.
cgs
Solve 'A x = b', where A is a square matrix, using the Conjugate Gradients Squared method.
gmres
Solve 'A x = b' using the Preconditioned GMRES iterative method with restart, a.k.a.
qmr
Solve 'A x = b' using the Quasi-Minimal Residual iterative method (without look-ahead).

Basic Vectorization

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

Broadcasting

bsxfun
The binary singleton expansion function performs broadcasting, that is, it applies a binary function F element-by-element to two array arguments A and B, and expands as necessary singleton dimensions

Function Application

arrayfun
Execute a function on each element of an array.
spfun
Compute 'f(S)' for the nonzero values of S.
cellfun
Evaluate the function named NAME on the elements of the cell array C.
structfun
Evaluate the function named NAME on the fields of the structure S.

Accumulation

accumarray
Create an array by accumulating the elements of a vector into the positions defined by their subscripts.
accumdim
Create an array by accumulating the slices of an array into the positions defined by their subscripts along a specified dimension.

JIT Compiler

jit_enable
Query or set the internal variable that enables Octave's JIT compiler.
jit_startcnt
Query or set the internal variable that determines whether JIT compilation will take place for a specific loop.
jit_failcnt
Query or set the internal variable that counts the number of JIT fail exceptions for Octave's JIT compiler.
debug_jit
Query or set the internal variable that determines whether debugging/tracing is enabled for Octave's JIT compiler.

Solvers

fsolve
Solve a system of nonlinear equations defined by the function FCN.
fzero
Find a zero of a univariate function.

Minimizers

fminbnd
Find a minimum point of a univariate function.
fminunc
Solve an unconstrained optimization problem defined by the function FCN.
fminsearch
Find a value of X which minimizes the function FUN.

Creating and Manipulating Diagonal/Permutation Matrices

disable_diagonal_matrix
Query or set the internal variable that controls whether diagonal matrices are stored in a special space-efficient format.
disable_permutation_matrix
Query or set the internal variable that controls whether permutation matrices are stored in a special space-efficient format.

Creation and Manipulation of Sparse Matrices

spdiags
A generalization of the function 'diag'.
speye
Return a sparse identity matrix of size MxN.
spones
Replace the nonzero entries of S with ones.
sprand
Generate a sparse matrix with uniformly distributed random values.
sprandn
Generate a sparse matrix with normally distributed random values.
sprandsym
Generate a symmetric random sparse matrix.
full
Return a full storage matrix from a sparse, diagonal, or permutation matrix, or a range.
spalloc
Create an M-by-N sparse matrix with pre-allocated space for at most NZ nonzero elements.
sparse
Create a sparse matrix from a full matrix, or row, column, value triplets.
spconvert
Convert a simple sparse matrix format easily generated by other programs into Octave's internal sparse format.
issparse
Return true if X is a sparse matrix.
nnz
Return the number of nonzero elements in A.
nonzeros
Return a vector of the nonzero values of the sparse matrix S.
nzmax
Return the amount of storage allocated to the sparse matrix SM.
spstats
Return the stats for the nonzero elements of the sparse matrix S.
spy
Plot the sparsity pattern of the sparse matrix X.
etree
Return the elimination tree for the matrix S.
etreeplot
Plot the elimination tree of the matrix A or A+A' if A in not symmetric.
gplot
Plot a graph defined by A and XY in the graph theory sense.
treeplot
Produce a graph of tree or forest.
treelayout
treelayout lays out a tree or a forest.
sparse_auto_mutate
Query or set the internal variable that controls whether Octave will automatically mutate sparse matrices to full matrices to save memory.
amd
Return the approximate minimum degree permutation of a matrix.
ccolamd
Constrained column approximate minimum degree permutation.
colamd
Compute the column approximate minimum degree permutation.
colperm
Return the column permutations such that the columns of 'S (:, P)' are ordered in terms of increasing number of nonzero elements.
csymamd
For a symmetric positive definite matrix S, return the permutation vector P such that 'S(P,P)' tends to have a sparser Cholesky factor than S.
dmperm
Perform a Dulmage-Mendelsohn permutation of the sparse matrix S.
symamd
For a symmetric positive definite matrix S, returns the permutation vector p such that 'S(P, P)' tends to have a sparser Cholesky factor than S.
symrcm
Return the symmetric reverse Cuthill-McKee permutation of S.

Linear Algebra on Sparse Matrices

normest
Estimate the 2-norm of the matrix A using a power series analysis.
normest1
Estimate the 1-norm of the matrix A using a block algorithm.
condest
Estimate the 1-norm condition number of a square matrix A using T test vectors and a randomized 1-norm estimator.
spparms
Query or set the parameters used by the sparse solvers and factorization functions.
sprank
Calculate the structural rank of the sparse matrix S.
symbfact
Perform a symbolic factorization analysis of the sparse matrix S.
spaugment
Create the augmented matrix of A.
eigs
Calculate a limited number of eigenvalues and eigenvectors of A, based on a selection criteria.
svds
Find a few singular values of the matrix A.

Iterative Techniques Applied to Sparse Matrices

pcg
Solve the linear system of equations 'A * X = B' by means of the Preconditioned Conjugate Gradient iterative method.
pcr
Solve the linear system of equations 'A * X = B' by means of the Preconditioned Conjugate Residuals iterative method.
ichol
Compute the incomplete Cholesky factorization of the sparse square matrix A.
ilu
Compute the incomplete LU factorization of the sparse square matrix A.

Functions of One Variable

quad
Numerically evaluate the integral of F from A to B using Fortran routines from QUADPACK.
quad_options
Query or set options for the function 'quad'.
quadv
Numerically evaluate the integral of F from A to B using an adaptive Simpson's rule.
quadl
Numerically evaluate the integral of F from A to B using an adaptive Lobatto rule.
quadgk
Numerically evaluate the integral of F from A to B using adaptive Gauss-Konrod quadrature.
quadcc
Numerically evaluate the integral of F from A to B using doubly-adaptive Clenshaw-Curtis quadrature.
trapz
Numerically evaluate the integral of points Y using the trapezoidal method.
cumtrapz
Cumulative numerical integration of points Y using the trapezoidal method.

Orthogonal Collocation

colloc
Compute derivative and integral weight matrices for orthogonal collocation.

Functions of Multiple Variables

dblquad
Numerically evaluate the double integral of F.
triplequad
Numerically evaluate the triple integral of F.

Ordinary Differential Equations

lsode
Ordinary Differential Equation (ODE) solver.
lsode_options
Query or set options for the function 'lsode'.
ode45
Solve a set of non-stiff Ordinary Differential Equations (non-stiff ODEs) with the well known explicit Dormand-Prince method of order 4.
ode23
Solve a set of non-stiff Ordinary Differential Equations (non-stiff ODEs) with the well known explicit Bogacki-Shampine method of order 3.
odeset
Create or modify an ODE options structure.
odeget
Query the value of the property FIELD in the ODE options structure ODE_OPT.
odeplot
Open a new figure window and plot the solution of an ode problem at each time step during the integration.

Differential-Algebraic Equations

daspk
Solve the set of differential-algebraic equations
daspk_options
Query or set options for the function 'daspk'.
dassl
Solve the set of differential-algebraic equations
dassl_options
Query or set options for the function 'dassl'.
dasrt
Solve the set of differential-algebraic equations
dasrt_options
Query or set options for the function 'dasrt'.

Linear Programming

glpk
Solve a linear program using the GNU GLPK library.

Quadratic Programming

qp
Solve a quadratic program (QP).
pqpnonneg
Minimize '1/2*x'*c*x + d'*x' subject to 'X >= 0'.

Nonlinear Programming

sqp
Minimize an objective function using sequential quadratic programming (SQP).

Linear Least Squares

ols
Ordinary least squares estimation.
gls
Generalized least squares model.
lsqnonneg
Minimize 'norm (C*X - d)' subject to 'X >= 0'.
lscov
Compute a generalized linear least squares fit.
optimset
Create options structure for optimization functions.
optimget
Return the specific option PARNAME from the optimization options structure OPTIONS created by 'optimset'.

Descriptive Statistics

mean
Compute the mean of the elements of the vector X.
median
Compute the median value of the elements of the vector X.
mode
Compute the most frequently occurring value in a dataset (mode).
range
Return the range, i.e., the difference between the maximum and the minimum of the input data.
iqr
Return the interquartile range, i.e., the difference between the upper and lower quartile of the input data.
meansq
Compute the mean square of the elements of the vector X.
std
Compute the standard deviation of the elements of the vector X.
var
Compute the variance of the elements of the vector X.
skewness
Compute the sample skewness of the elements of X.
kurtosis
Compute the sample kurtosis of the elements of X.
moment
Compute the P-th central moment of the vector X.
quantile
For a sample, X, calculate the quantiles, Q, corresponding to the cumulative probability values in P.
prctile
For a sample X, compute the quantiles, Q, corresponding to the cumulative probability values, P, in percent.
statistics
Return a vector with the minimum, first quartile, median, third quartile, maximum, mean, standard deviation, skewness, and kurtosis of the elements of the vector X.

Basic Statistical Functions

center
Center data by subtracting its mean.
zscore
Compute the Z score of X
histc
Compute histogram counts.
nchoosek
Compute the binomial coefficient of N or list all possible combinations of a SET of items.
perms
Generate all permutations of V with one row per permutation.
ranks
Return the ranks of X along the first non-singleton dimension adjusted for ties.
run_count
Count the upward runs along the first non-singleton dimension of X of length 1, 2, ..., N-1 and greater than or equal to N.
runlength
Find the lengths of all sequences of common values.
probit
Return the probit (the quantile of the standard normal distribution) for each element of P.
logit
Compute the logit for each value of P
cloglog
Return the complementary log-log function of X.
table
Create a contingency table T from data vectors.

Statistical Plots

qqplot
Perform a QQ-plot (quantile plot).
ppplot
Perform a PP-plot (probability plot).

Correlation and Regression Analysis

cov
Compute the covariance matrix.
corr
Compute matrix of correlation coefficients.
spearman
Compute Spearman's rank correlation coefficient RHO.
kendall
Compute Kendall's TAU.
logistic_regression
Perform ordinal logistic regression.

Distributions

betapdf
For each element of X, compute the probability density function (PDF) at X of the Beta distribution with parameters A and B.
betacdf
For each element of X, compute the cumulative distribution function (CDF) at X of the Beta distribution with parameters A and B.
betainv
For each element of X, compute the quantile (the inverse of the CDF) at X of the Beta distribution with parameters A and B.
binopdf
For each element of X, compute the probability density function (PDF) at X of the binomial distribution with parameters N and P, where N is the number of trials and P is the probability of success.
binocdf
For each element of X, compute the cumulative distribution function (CDF) at X of the binomial distribution with parameters N and P, where N is the number of trials and P is the probability of success
binoinv
For each element of X, compute the quantile (the inverse of the CDF) at X of the binomial distribution with parameters N and P, where N is the number of trials and P is the probability of success.
cauchy_pdf
For each element of X, compute the probability density function (PDF) at X of the Cauchy distribution with location parameter LOCATION and scale parameter SCALE > 0.
cauchy_cdf
For each element of X, compute the cumulative distribution function (CDF) at X of the Cauchy distribution with location parameter LOCATION and scale parameter SCALE.
cauchy_inv
For each element of X, compute the quantile (the inverse of the CDF) at X of the Cauchy distribution with location parameter LOCATION and scale parameter SCALE.
chi2pdf
For each element of X, compute the probability density function (PDF) at X of the chi-square distribution with N degrees of freedom.
chi2cdf
For each element of X, compute the cumulative distribution function (CDF) at X of the chi-square distribution with N degrees of freedom.
chi2inv
For each element of X, compute the quantile (the inverse of the CDF) at X of the chi-square distribution with N degrees of freedom.
discrete_pdf
For each element of X, compute the probability density function (PDF) at X of a univariate discrete distribution which assumes the values in V with probabilities P.
discrete_cdf
For each element of X, compute the cumulative distribution function (CDF) at X of a univariate discrete distribution which assumes the values in V with probabilities P.
discrete_inv
For each element of X, compute the quantile (the inverse of the CDF) at X of the univariate distribution which assumes the values in V with probabilities P.
empirical_pdf
For each element of X, compute the probability density function (PDF) at X of the empirical distribution obtained from the univariate sample DATA.
empirical_cdf
For each element of X, compute the cumulative distribution function (CDF) at X of the empirical distribution obtained from the univariate sample DATA.
empirical_inv
For each element of X, compute the quantile (the inverse of the CDF) at X of the empirical distribution obtained from the univariate sample DATA.
exppdf
For each element of X, compute the probability density function (PDF) at X of the exponential distribution with mean LAMBDA.
expcdf
For each element of X, compute the cumulative distribution function (CDF) at X of the exponential distribution with mean LAMBDA.
expinv
For each element of X, compute the quantile (the inverse of the CDF) at X of the exponential distribution with mean LAMBDA.
fpdf
For each element of X, compute the probability density function (PDF) at X of the F distribution with M and N degrees of freedom.
fcdf
For each element of X, compute the cumulative distribution function (CDF) at X of the F distribution with M and N degrees of freedom.
finv
For each element of X, compute the quantile (the inverse of the CDF) at X of the F distribution with M and N degrees of freedom.
gampdf
For each element of X, return the probability density function (PDF) at X of the Gamma distribution with shape parameter A and scale B.
gamcdf
For each element of X, compute the cumulative distribution function (CDF) at X of the Gamma distribution with shape parameter A and scale B.
gaminv
For each element of X, compute the quantile (the inverse of the CDF) at X of the Gamma distribution with shape parameter A and scale B.
geopdf
For each element of X, compute the probability density function (PDF) at X of the geometric distribution with parameter P.
geocdf
For each element of X, compute the cumulative distribution function (CDF) at X of the geometric distribution with parameter P.
geoinv
For each element of X, compute the quantile (the inverse of the CDF) at X of the geometric distribution with parameter P.
hygepdf
Compute the probability density function (PDF) at X of the hypergeometric distribution with parameters T, M, and N.
hygecdf
Compute the cumulative distribution function (CDF) at X of the hypergeometric distribution with parameters T, M, and N.
hygeinv
For each element of X, compute the quantile (the inverse of the CDF) at X of the hypergeometric distribution with parameters T, M, and N.
kolmogorov_smirnov_cdf
Return the cumulative distribution function (CDF) at X of the Kolmogorov-Smirnov distribution.
laplace_pdf
For each element of X, compute the probability density function (PDF) at X of the Laplace distribution.
laplace_cdf
For each element of X, compute the cumulative distribution function (CDF) at X of the Laplace distribution.
laplace_inv
For each element of X, compute the quantile (the inverse of the CDF) at X of the Laplace distribution.
logistic_pdf
For each element of X, compute the PDF at X of the logistic distribution.
logistic_cdf
For each element of X, compute the cumulative distribution function (CDF) at X of the logistic distribution.
logistic_inv
For each element of X, compute the quantile (the inverse of the CDF) at X of the logistic distribution.
lognpdf
For each element of X, compute the probability density function (PDF) at X of the lognormal distribution with parameters MU and SIGMA.
logncdf
For each element of X, compute the cumulative distribution function (CDF) at X of the lognormal distribution with parameters MU and SIGMA.
logninv
For each element of X, compute the quantile (the inverse of the CDF) at X of the lognormal distribution with parameters MU and SIGMA.
nbinpdf
For each element of X, compute the probability density function (PDF) at X of the negative binomial distribution with parameters N and P.
nbincdf
For each element of X, compute the cumulative distribution function (CDF) at X of the negative binomial distribution with parameters N and P.
nbininv
For each element of X, compute the quantile (the inverse of the CDF) at X of the negative binomial distribution with parameters N and P.
normpdf
For each element of X, compute the probability density function (PDF) at X of the normal distribution with mean MU and standard deviation SIGMA.
normcdf
For each element of X, compute the cumulative distribution function (CDF) at X of the normal distribution with mean MU and standard deviation SIGMA.
norminv
For each element of X, compute the quantile (the inverse of the CDF) at X of the normal distribution with mean MU and standard deviation SIGMA.
poisspdf
For each element of X, compute the probability density function (PDF) at X of the Poisson distribution with parameter LAMBDA.
poisscdf
For each element of X, compute the cumulative distribution function (CDF) at X of the Poisson distribution with parameter LAMBDA.
poissinv
For each element of X, compute the quantile (the inverse of the CDF) at X of the Poisson distribution with parameter LAMBDA.
stdnormal_pdf
For each element of X, compute the probability density function (PDF) at X of the standard normal distribution (mean = 0, standard deviation = 1).
stdnormal_cdf
For each element of X, compute the cumulative distribution function (CDF) at X of the standard normal distribution (mean = 0, standard deviation = 1).
stdnormal_inv
For each element of X, compute the quantile (the inverse of the CDF) at X of the standard normal distribution (mean = 0, standard deviation = 1).
tpdf
For each element of X, compute the probability density function (PDF) at X of the T (Student) distribution with N degrees of freedom.
tcdf
For each element of X, compute the cumulative distribution function (CDF) at X of the t (Student) distribution with N degrees of freedom.
tinv
For each element of X, compute the quantile (the inverse of the CDF) at X of the t (Student) distribution with N degrees of freedom.
unidpdf
For each element of X, compute the probability density function (PDF) at X of a discrete uniform distribution which assumes the integer values 1-N with equal probability.
unidcdf
For each element of X, compute the cumulative distribution function (CDF) at X of a discrete uniform distribution which assumes the integer values 1-N with equal probability.
unidinv
For each element of X, compute the quantile (the inverse of the CDF) at X of the discrete uniform distribution which assumes the integer values 1-N with equal probability.
unifpdf
For each element of X, compute the probability density function (PDF) at X of the uniform distribution on the interval [A, B].
unifcdf
For each element of X, compute the cumulative distribution function (CDF) at X of the uniform distribution on the interval [A, B].
unifinv
For each element of X, compute the quantile (the inverse of the CDF) at X of the uniform distribution on the interval [A, B].
wblpdf
Compute the probability density function (PDF) at X of the Weibull distribution with scale parameter SCALE and shape parameter SHAPE.
wblcdf
Compute the cumulative distribution function (CDF) at X of the Weibull distribution with scale parameter SCALE and shape parameter SHAPE.
wblinv
Compute the quantile (the inverse of the CDF) at X of the Weibull distribution with scale parameter SCALE and shape parameter SHAPE.

Tests

anova
Perform a one-way analysis of variance (ANOVA).
bartlett_test
Perform a Bartlett test for the homogeneity of variances in the data vectors X1, X2, ..., XK, where K > 1.
chisquare_test_homogeneity
Given two samples X and Y, perform a chisquare test for homogeneity of the null hypothesis that X and Y come from the same distribution, based on the partition induced by the (strictly increasing) ent
chisquare_test_independence
Perform a chi-square test for independence based on the contingency table X.
cor_test
Test whether two samples X and Y come from uncorrelated populations.
f_test_regression
Perform an F test for the null hypothesis rr * b = r in a classical normal regression model y = X * b + e.
hotelling_test
For a sample X from a multivariate normal distribution with unknown mean and covariance matrix, test the null hypothesis that 'mean (X) == M'.
hotelling_test_2
For two samples X from multivariate normal distributions with the same number of variables (columns), unknown means and unknown equal covariance matrices, test the null hypothesis 'mean (X) == mean (Y
kolmogorov_smirnov_test
Perform a Kolmogorov-Smirnov test of the null hypothesis that the sample X comes from the (continuous) distribution DIST.
kolmogorov_smirnov_test_2
Perform a 2-sample Kolmogorov-Smirnov test of the null hypothesis that the samples X and Y come from the same (continuous) distribution.
kruskal_wallis_test
Perform a Kruskal-Wallis one-factor analysis of variance.
manova
Perform a one-way multivariate analysis of variance (MANOVA).
mcnemar_test
For a square contingency table X of data cross-classified on the row and column variables, McNemar's test can be used for testing the null hypothesis of symmetry of the classification probabilities.
prop_test_2
If X1 and N1 are the counts of successes and trials in one sample, and X2 and N2 those in a second one, test the null hypothesis that the success probabilities P1 and P2 are the same.
run_test
Perform a chi-square test with 6 degrees of freedom based on the upward runs in the columns of X.
sign_test
For two matched-pair samples X and Y, perform a sign test of the null hypothesis PROB (X > Y) == PROB (X < Y) == 1/2.
t_test
For a sample X from a normal distribution with unknown mean and variance, perform a t-test of the null hypothesis 'mean (X) == M'.
t_test_2
For two samples x and y from normal distributions with unknown means and unknown equal variances, perform a two-sample t-test of the null hypothesis of equal means.
t_test_regression
Perform a t test for the null hypothesis 'RR * B = R' in a classical normal regression model 'Y = X * B + E'.
u_test
For two samples X and Y, perform a Mann-Whitney U-test of the null hypothesis PROB (X > Y) == 1/2 == PROB (X < Y).
var_test
For two samples X and Y from normal distributions with unknown means and unknown variances, perform an F-test of the null hypothesis of equal variances.
welch_test
For two samples X and Y from normal distributions with unknown means and unknown and not necessarily equal variances, perform a Welch test of the null hypothesis of equal means.
wilcoxon_test
For two matched-pair sample vectors X and Y, perform a Wilcoxon signed-rank test of the null hypothesis PROB (X > Y) == 1/2.
z_test
Perform a Z-test of the null hypothesis 'mean (X) == M' for a sample X from a normal distribution with unknown mean and known variance V.
z_test_2
For two samples X and Y from normal distributions with unknown means and known variances V_X and V_Y, perform a Z-test of the hypothesis of equal means.

Random Number Generation

betarnd
Return a matrix of random samples from the Beta distribution with parameters A and B.
binornd
Return a matrix of random samples from the binomial distribution with parameters N and P, where N is the number of trials and P is the probability of success.
cauchy_rnd
Return a matrix of random samples from the Cauchy distribution with parameters LOCATION and SCALE.
chi2rnd
Return a matrix of random samples from the chi-square distribution with N degrees of freedom.
discrete_rnd
Return a matrix of random samples from the univariate distribution which assumes the values in V with probabilities P.
empirical_rnd
Return a matrix of random samples from the empirical distribution obtained from the univariate sample DATA.
exprnd
Return a matrix of random samples from the exponential distribution with mean LAMBDA.
frnd
Return a matrix of random samples from the F distribution with M and N degrees of freedom.
gamrnd
Return a matrix of random samples from the Gamma distribution with shape parameter A and scale B.
geornd
Return a matrix of random samples from the geometric distribution with parameter P.
hygernd
Return a matrix of random samples from the hypergeometric distribution with parameters T, M, and N.
laplace_rnd
Return a matrix of random samples from the Laplace distribution.
logistic_rnd
Return a matrix of random samples from the logistic distribution.
lognrnd
Return a matrix of random samples from the lognormal distribution with parameters MU and SIGMA.
nbinrnd
Return a matrix of random samples from the negative binomial distribution with parameters N and P.
normrnd
Return a matrix of random samples from the normal distribution with parameters mean MU and standard deviation SIGMA.
poissrnd
Return a matrix of random samples from the Poisson distribution with parameter LAMBDA.
stdnormal_rnd
Return a matrix of random samples from the standard normal distribution (mean = 0, standard deviation = 1).
trnd
Return a matrix of random samples from the t (Student) distribution with N degrees of freedom.
unidrnd
Return a matrix of random samples from the discrete uniform distribution which assumes the integer values 1-N with equal probability.
unifrnd
Return a matrix of random samples from the uniform distribution on [A, B].
wblrnd
Return a matrix of random samples from the Weibull distribution with parameters SCALE and SHAPE.
wienrnd
Return a simulated realization of the D-dimensional Wiener Process on the interval [0, T].

General

unique
Return the unique elements of X sorted in ascending order.

Set Operations

intersect
Return the unique elements common to both A and B sorted in ascending order.
union
Return the unique elements that are in either A or B sorted in ascending order.
setdiff
Return the unique elements in A that are not in B sorted in ascending order.
setxor
Return the unique elements exclusive to sets A or B sorted in ascending order.
ismember
Return a logical matrix TF with the same shape as A which is true (1) if the element in A is found in S and false (0) if it is not.
powerset
Compute the powerset (all subsets) of the set A.

Evaluating Polynomials

polyval
Evaluate the polynomial P at the specified values of X.
polyvalm
Evaluate a polynomial in the matrix sense.

Finding Roots

roots
Compute the roots of the polynomial C.
polyeig
Solve the polynomial eigenvalue problem of degree L.
compan
Compute the companion matrix corresponding to polynomial coefficient vector C.
mpoles
Identify unique poles in P and their associated multiplicity.

Products of Polynomials

conv
Convolve two vectors A and B.
convn
Return the n-D convolution of A and B.
deconv
Deconvolve two vectors.
conv2
Return the 2-D convolution of A and B.
polygcd
Find the greatest common divisor of two polynomials.
residue
The first calling form computes the partial fraction expansion for the quotient of the polynomials, B and A.

Derivatives / Integrals / Transforms

polyder
Return the coefficients of the derivative of the polynomial whose coefficients are given by the vector P.
polyint
Return the coefficients of the integral of the polynomial whose coefficients are represented by the vector P.
polyaffine
Return the coefficients of the polynomial vector F after an affine transformation.

Polynomial Interpolation

polyfit
Return the coefficients of a polynomial P(X) of degree N that minimizes the least-squares-error of the fit to the points '[X, Y]'.
splinefit
Fit a piecewise cubic spline with breaks (knots) BREAKS to the noisy data, X and Y.
padecoef
Compute the Nth-order Pade' approximant of the continuous-time delay T in transfer function form.
mkpp
Construct a piecewise polynomial (pp) structure from sample points BREAKS and coefficients COEFS.
unmkpp
Extract the components of a piecewise polynomial structure PP.
ppval
Evaluate the piecewise polynomial structure PP at the points XI.
ppder
Compute the piecewise M-th derivative of a piecewise polynomial struct PP.
ppint
Compute the integral of the piecewise polynomial struct PP.
ppjumps
Evaluate the boundary jumps of a piecewise polynomial.

Miscellaneous Functions

poly
If A is a square N-by-N matrix, 'poly (A)' is the row vector of the coefficients of 'det (z * eye (N) - A)', the characteristic polynomial of A.
polyout
Display a formatted version of the polynomial C.
polyreduce
Reduce a polynomial coefficient vector to a minimum number of terms by stripping off any leading zeros.

One-dimensional Interpolation

interp1
One-dimensional interpolation.
interpft
Fourier interpolation.
spline
Return the cubic spline interpolant of points X and Y.

Multi-dimensional Interpolation

interp2
Two-dimensional interpolation.
interp3
Three-dimensional interpolation.
interpn
Perform N-dimensional interpolation, where N is at least two.

Delaunay Triangulation

delaunay
Compute the Delaunay triangulation for a 2-D or 3-D set of points.
delaunayn
Compute the Delaunay triangulation for an N-dimensional set of points.
triplot
Plot a 2-D triangular mesh.
trimesh
Plot a 3-D triangular wireframe mesh.
trisurf
Plot a 3-D triangular surface.
tetramesh
Display the tetrahedrons defined in the m-by-4 matrix T as 3-D patches.
tsearch
Search for the enclosing Delaunay convex hull.
tsearchn
Search for the enclosing Delaunay convex hull.
dsearch
Return the index IDX of the closest point in 'X, Y' to the elements '[XI(:), YI(:)]'.
dsearchn
Return the index IDX of the closest point in X to the elements XI.

Voronoi Diagrams

voronoi
Plot the Voronoi diagram of points '(X, Y)'.
voronoin
Compute N-dimensional Voronoi facets.
polyarea
Determine area of a polygon by triangle method.
rectint
Compute area or volume of intersection of rectangles or N-D boxes.
inpolygon
For a polygon defined by vertex points '(XV, YV)', return true if the points '(X, Y)' are inside (or on the boundary) of the polygon; Otherwise, return false.

Convex Hull

convhull
Compute the convex hull of the set of points defined by the arrays X and Y.
convhulln
Compute the convex hull of the set of points PTS.

Interpolation on Scattered Data

griddata
Generate a regular mesh from irregular data using interpolation.
griddata3
Generate a regular mesh from irregular data using interpolation.
griddatan
Generate a regular mesh from irregular data using interpolation.

General

fft
Compute the discrete Fourier transform of A using a Fast Fourier Transform (FFT) algorithm.
ifft
Compute the inverse discrete Fourier transform of A using a Fast Fourier Transform (FFT) algorithm.
fft2
Compute the two-dimensional discrete Fourier transform of A using a Fast Fourier Transform (FFT) algorithm.
ifft2
Compute the inverse two-dimensional discrete Fourier transform of A using a Fast Fourier Transform (FFT) algorithm.
fftn
Compute the N-dimensional discrete Fourier transform of A using a Fast Fourier Transform (FFT) algorithm.
ifftn
Compute the inverse N-dimensional discrete Fourier transform of A using a Fast Fourier Transform (FFT) algorithm.
fftw
Manage FFTW wisdom data.
fftconv
Convolve two vectors using the FFT for computation.
fftfilt
Filter X with the FIR filter B using the FFT.
filter
Apply a 1-D digital filter to the data X.
filter2
Apply the 2-D FIR filter B to X.
freqz
Return the complex frequency response H of the rational IIR filter whose numerator and denominator coefficients are B and A, respectively.
freqz_plot
Plot the magnitude and phase response of H.
sinc
Compute the sinc function.
unwrap
Unwrap radian phases by adding or subtracting multiples of 2*pi as appropriate to remove jumps greater than TOL.
arch_fit
Fit an ARCH regression model to the time series Y using the scoring algorithm in Engle's original ARCH paper.
arch_rnd
Simulate an ARCH sequence of length T with AR coefficients B and CH coefficients A.
arch_test
For a linear regression model
arma_rnd
Return a simulation of the ARMA model.
autoreg_matrix
Given a time series (vector) Y, return a matrix with ones in the first column and the first K lagged values of Y in the other columns.
bartlett
Return the filter coefficients of a Bartlett (triangular) window of length M.
blackman
Return the filter coefficients of a Blackman window of length M.
detrend
If X is a vector, 'detrend (X, P)' removes the best fit of a polynomial of order P from the data X.
diffpara
Return the estimator D for the differencing parameter of an integrated time series.
durbinlevinson
Perform one step of the Durbin-Levinson algorithm.
fftshift
Perform a shift of the vector X, for use with the 'fft' and 'ifft' functions, in order to move the frequency 0 to the center of the vector or matrix.
ifftshift
Undo the action of the 'fftshift' function.
fractdiff
Compute the fractional differences (1-L)^d x where L denotes the lag-operator and d is greater than -1.
hamming
Return the filter coefficients of a Hamming window of length M.
hanning
Return the filter coefficients of a Hanning window of length M.
hurst
Estimate the Hurst parameter of sample X via the rescaled range statistic.
pchip
Return the Piecewise Cubic Hermite Interpolating Polynomial (pchip) of points X and Y.
periodogram
Return the periodogram (Power Spectral Density) of X.
sinetone
Return a sinetone of frequency FREQ with a length of SEC seconds at sampling rate RATE and with amplitude AMPL.
sinewave
Return an M-element vector with I-th element given by 'sin (2 * pi * (I+D-1) / N)'.
spectral_adf
Return the spectral density estimator given a vector of autocovariances C, window name WIN, and bandwidth, B.
spectral_xdf
Return the spectral density estimator given a data vector X, window name WIN, and bandwidth, B.
spencer
Return Spencer's 15 point moving average of each column of X.
stft
Compute the short-time Fourier transform of the vector X with NUM_COEF coefficients by applying a window of WIN_SIZE data points and an increment of INC points.
synthesis
Compute a signal from its short-time Fourier transform Y and a 3-element vector C specifying window size, increment, and window type.
yulewalker
Fit an AR (p)-model with Yule-Walker estimates given a vector C of autocovariances '[gamma_0, ..., gamma_p]'.

Loading and Saving Images

imread
Read images from various file formats.
imwrite
Write images in various file formats.
IMAGE_PATH
Query or set the internal variable that specifies a colon separated list of directories in which to search for image files.
imfinfo
Read image information from a file.
imformats
Manage supported image formats.

Displaying Images

imshow
Display the image IM, where IM can be a 2-dimensional (grayscale image) or a 3-dimensional (RGB image) matrix.
image
Display a matrix as an indexed color image.
imagesc
Display a scaled version of the matrix IMG as a color image.

Representing Images

im2double
Convert image to double precision.
iscolormap
Return true if CMAP is a colormap.
gray2ind
Convert a grayscale or binary intensity image to an indexed image.
ind2gray
Convert a color indexed image to a grayscale intensity image.
rgb2ind
Convert an image in red-green-blue (RGB) color space to an indexed image.
ind2rgb
Convert an indexed image to red, green, and blue color components.
colormap
Query or set the current colormap.
rgbplot
Plot the components of a colormap.
autumn
Create color colormap.
bone
Create color colormap.
colorcube
Create color colormap.
cool
Create color colormap.
copper
Create color colormap.
cubehelix
Create cubehelix colormap.
flag
Create color colormap.
gray
Create gray colormap.
hot
Create color colormap.
hsv
Create color colormap.
jet
Create color colormap.
lines
Create color colormap.
ocean
Create color colormap.
pink
Create color colormap.
prism
Create color colormap.
rainbow
Create color colormap.
spring
Create color colormap.
summer
Create color colormap.
viridis
Create color colormap.
white
Create color colormap.
winter
Create color colormap.
contrast
Return a gray colormap that maximizes the contrast in an image.
brighten
Brighten or darken a colormap.
spinmap
Cycle the colormap for T seconds with a color increment of INC.
whitebg
Invert the colors in the current color scheme.
cmunique
Convert an input image X to an ouput indexed image Y which uses the smallest colormap possible NEWMAP.
cmpermute
Reorder colors in a colormap.

Color Conversion

rgb2hsv
Transform a colormap or image from RGB to HSV color space.
hsv2rgb
Transform a colormap or image from HSV to RGB color space.
rgb2ntsc
Transform a colormap or image from red-green-blue (RGB) color space to luminance-chrominance (NTSC) space.
ntsc2rgb
Transform a colormap or image from luminance-chrominance (NTSC) space to red-green-blue (RGB) color space.

Audio File Utilities

audioinfo
Return information about an audio file specified by FILENAME.
audioread
Read the audio file FILENAME and return the audio data Y and sampling rate FS.
audiowrite
Write audio data from the matrix Y to FILENAME at sampling rate FS with the file format determined by the file extension.
audioformats
Display information about all supported audio formats.

Audio Device Information

audiodevinfo
Return a structure describing the available audio input and output devices.

Audio Player

@audioplayer/audioplayer
Create an audioplayer object that will play back data Y at sample rate FS.
@audioplayer/play
Play audio stored in the audioplayer object PLAYER without blocking.
@audioplayer/playblocking
Play audio stored in the audioplayer object PLAYER with blocking.
@audioplayer/pause
Pause the audioplayer PLAYER.
@audioplayer/resume
Resume playback for the paused audioplayer object PLAYER.
@audioplayer/stop
Stop the playback for the audioplayer PLAYER and reset the relevant variables to their starting values.
@audioplayer/isplaying
Return true if the audioplayer object PLAYER is currently playing back audio and false otherwise.
@audioplayer/get
Return the VALUE of the property identified by NAME.
@audioplayer/set
Set the value of property specified by NAME to a given VALUE.

Audio Recorder

@audiorecorder/audiorecorder
Create an audiorecorder object recording 8 bit mono audio at 8000 Hz sample rate.
@audiorecorder/record
Record audio without blocking using the audiorecorder object RECORDER until stopped or paused by the STOP or PAUSE method.
@audiorecorder/recordblocking
Record audio with blocking (synchronous I/O).
@audiorecorder/pause
Pause recording with audiorecorder object RECORDER.
@audiorecorder/resume
Resume recording with the paused audiorecorder object RECORDER.
@audiorecorder/stop
Stop the audiorecorder object RECORDER and clean up any audio streams.
@audiorecorder/isrecording
Return true if the audiorecorder object RECORDER is currently recording audio and false otherwise.
@audiorecorder/getaudiodata
Return recorder audio data as a matrix with values between -1.0 and 1.0 and with as many columns as there are channels in the recorder.
@audiorecorder/getplayer
Return an audioplayer object with data recorded by the audiorecorder object RECORDER.
@audiorecorder/play
Play the audio recorded in RECORDER and return a corresponding audioplayer object.
@audiorecorder/get
Return the VALUE of the property identified by NAME.
@audiorecorder/set
Set the value of property specified by NAME to a given VALUE.

Audio Data Processing

lin2mu
Convert audio data from linear to mu-law.
mu2lin
Convert audio data from mu-law to linear.
record
Record SEC seconds of audio from the system's default audio input at a sampling rate of 8000 samples per second.
sound
Play audio data Y at sample rate FS to the default audio device.
soundsc
Scale the audio data Y and play it at sample rate FS to the default audio device.

Creating a Class

isobject
Return true if X is a class object.
methods
List the names of the public methods for the object OBJ or the named class CLASSNAME.
ismethod
Return true if the string METHOD is a valid method of the object OBJ or of the class CLSNAME.

Class Methods

display
Display the contents of the object OBJ.
saveobj
Method of a class to manipulate an object prior to saving it to a file.
loadobj
Method of a class to manipulate an object after loading it from a file.

Indexing Objects

subsref
Perform the subscripted element selection operation on VAL according to the subscript specified by IDX.
subsasgn
Perform the subscripted assignment operation according to the subscript specified by IDX.
optimize_subsasgn_calls
Query or set the internal flag for 'subsasgn' method call optimizations.
subsindex
Convert an object to an index vector.
colon
Return the result of the colon expression corresponding to BASE, LIMIT, and optionally, INCREMENT.

Overloading Objects

superiorto
When called from a class constructor, mark the object currently constructed as having a higher precedence than CLASS_NAME.
inferiorto
When called from a class constructor, mark the object currently constructed as having a lower precedence than CLASS_NAME.

I/O Dialogs

uigetdir
Open a GUI dialog for selecting a directory.
uigetfile
Open a GUI dialog for selecting a file and return the filename FNAME, the path to this file FPATH, and the filter index FLTIDX.
uiputfile
Open a GUI dialog for selecting a file.
errordlg
Display an error dialog box with error message MSG and caption TITLE.
helpdlg
Display a help dialog box with help message MSG and caption TITLE.
inputdlg
Return user input from a multi-textfield dialog box in a cell array of strings, or an empty cell array if the dialog is closed by the Cancel button.
listdlg
Return user inputs from a list dialog box in a vector of selection indices (SEL) and a flag indicating how the user closed the dialog box (OK).
msgbox
Display MSG using a message dialog box.
questdlg
Display MSG using a question dialog box and return the caption of the activated button.
warndlg
Display a warning dialog box with warning message MSG and caption TITLE.
dialog
Create an empty modal dialog window that other uicontrols can be added to.

Progress Bar

waitbar
Return a handle H to a new progress indicator ("waitbar") object.

UI Elements

uimenu
Create a uimenu object and return a handle to it.
uibuttongroup
Create a uibuttongroup object and return a handle to it.
uicontextmenu
Create a uicontextmenu object and return a handle to it.
uicontrol
Create a uicontrol object and return a handle to it.
uipanel
Create a uipanel object and return a handle to it.
uipushtool
Create a uipushtool object and return a handle to it.
uitoggletool
Create a uitoggletool object and return a handle to it.
uitoolbar
Create a uitoolbar object and return a handle to it.

GUI Utility Functions

desktop
Return true if the desktop (GUI) is currently in use.
guidata
Query or set user-custom GUI data.
guihandles
Return a structure of object handles for the figure associated with handle H.
have_window_system
Return true if a window system is available (X11, Windows, or Apple OS X) and false otherwise.
isguirunning
Return true if Octave is running in GUI mode and false otherwise.
uiwait
Suspend program execution until the figure with handle H is deleted or 'uiresume' is called.
uiresume
Resume program execution suspended with 'uiwait'.
waitfor
Suspend the execution of the current program until a condition is satisfied on the graphics handle H.

User-Defined Preferences

getpref
Return the preference value corresponding to the named preference PREF in the preference group GROUP.
setpref
Set the preference PREF to the given VAL in the named preference group GROUP.
addpref
Add the preference PREF and associated value VAL to the named preference group GROUP.
rmpref
Remove the named preference PREF from the preference group GROUP.
ispref
Return true if the named preference PREF exists in the preference group GROUP.
prefdir
Return the directory that holds the preferences for Octave.
preferences
Display the GUI preferences dialog window for Octave.

Timing Utilities

time
Return the current time as the number of seconds since the epoch.
now
Return the current local date/time as a serial day number (see 'datenum').
ctime
Convert a value returned from 'time' (or any other non-negative integer), to the local time and return a string of the same form as 'asctime'.
gmtime
Given a value returned from 'time', or any non-negative integer, return a time structure corresponding to CUT (Coordinated Universal Time).
localtime
Given a value returned from 'time', or any non-negative integer, return a time structure corresponding to the local time zone.
mktime
Convert a time structure corresponding to the local time to the number of seconds since the epoch.
asctime
Convert a time structure to a string using the following format: "ddd mmm mm HH:MM:SS yyyy\n".
strftime
Format the time structure TM_STRUCT in a flexible way using the format string FMT that contains '%' substitutions similar to those in 'printf'.
strptime
Convert the string STR to the time structure TM_STRUCT under the control of the format string FMT.
clock
Return the current local date and time as a date vector.
date
Return the current date as a character string in the form DD-MMM-YYYY.
etime
Return the difference in seconds between two time values returned from 'clock' (T2 - T1).
cputime
Return the CPU time used by your Octave session.
is_leap_year
Return true if YEAR is a leap year and false otherwise.
tic
Set or check a wall-clock timer.
pause
Suspend the execution of the program for N seconds.
datenum
Return the date/time input as a serial day number, with Jan 1, 0000 defined as day 1.
datestr
Format the given date/time according to the format 'f' and return the result in STR.
datevec
Convert a serial date number (see 'datenum') or date string (see 'datestr') into a date vector.
addtodate
Add Q amount of time (with units F) to the serial datenum, D.
calendar
Return the current monthly calendar in a 6x7 matrix.
weekday
Return the day of the week as a number in N and as a string in S.
eomday
Return the last day of the month M for the year Y.
datetick
Add date formatted tick labels to an axis.

Filesystem Utilities

movefile
Move the source files or directories F1 to the destination F2.
rename
Change the name of file OLD to NEW.
copyfile
Copy the source files or directories F1 to the destination F2.
unlink
Delete the file named FILE.
link
Create a new link (also known as a hard link) to an existing file.
symlink
Create a symbolic link NEW which contains the string OLD.
readlink
Read the value of the symbolic link SYMLINK.
mkdir
Create a directory named DIR in the directory PARENT, creating any intermediate directories if necessary.
rmdir
Remove the directory named DIR.
confirm_recursive_rmdir
Query or set the internal variable that controls whether Octave will ask for confirmation before recursively removing a directory tree.
mkfifo
Create a FIFO special file named NAME with file mode MODE.
umask
Set the permission mask for file creation.
stat
Return a structure INFO containing the following information about FILE or file identifier FID.
S_ISBLK
Return true if MODE corresponds to a block device.
S_ISCHR
Return true if MODE corresponds to a character device.
S_ISDIR
Return true if MODE corresponds to a directory.
S_ISFIFO
Return true if MODE corresponds to a fifo.
S_ISLNK
Return true if MODE corresponds to a symbolic link.
S_ISREG
Return true if MODE corresponds to a regular file.
S_ISSOCK
Return true if MODE corresponds to a socket.
fileattrib
Return information about FILE.
isdir
Return true if F is a directory.
readdir
Return the names of files in the directory DIR as a cell array of strings.
glob
Given an array of pattern strings (as a char array or a cell array) in PATTERN, return a cell array of filenames that match any of them, or an empty cell array if no patterns match.
file_in_path
Return the absolute name of FILE if it can be found in PATH.
filesep
Return the system-dependent character used to separate directory names.
filemarker
Query or set the character used to separate the filename from the subfunction names contained within the file.
fileparts
Return the directory, name, and extension components of FILENAME.
fullfile
Build complete filename from separate parts.
tilde_expand
Perform tilde expansion on STRING.
canonicalize_file_name
Return the canonical name of file FNAME.
make_absolute_filename
Return the full name of FILE beginning from the root of the file system.
is_absolute_filename
Return true if FILE is an absolute filename.
is_rooted_relative_filename
Return true if FILE is a rooted-relative filename.
recycle
Query or set the preference for recycling deleted files.

File Archiving Utilities

bunzip2
Unpack the bzip2 archive BZFILE.
gzip
Compress the list of files and directories specified in FILES.
gunzip
Unpack the gzip archive GZFILE.
tar
Pack the list of files and directories specified in FILES into the TAR archive TARFILE.
untar
Unpack the TAR archive TARFILE.
zip
Compress the list of files and directories specified in FILES into the ZIP archive ZIPFILE.
unzip
Unpack the ZIP archive ZIPFILE.
unpack
Unpack the archive FILE based on its extension to the directory DIR.
bzip2
Compress the list of files specified in FILES.

Networking Utilities

gethostname
Return the hostname of the system where Octave is running.
@ftp/ftp
Connect to the FTP server HOST with USERNAME and PASSWORD.
@ftp/close
Close the FTP connection represented by the FTP object F.
@ftp/mget
Download a remote file FILE or directory DIR to the local directory on the FTP connection F.
@ftp/mput
Upload the local file FILE into the current remote directory on the FTP connection F.
@ftp/cd
Get or set the remote directory on the FTP connection F.
@ftp/dir
List the current directory in verbose form for the FTP connection F.
@ftp/ascii
Set the FTP connection F to use ASCII mode for transfers.
@ftp/binary
Set the FTP connection F to use binary mode for transfers.
@ftp/delete
Delete the remote file FILE over the FTP connection F.
@ftp/rename
Rename or move the remote file or directory OLDNAME to NEWNAME, over the FTP connection F.
@ftp/mkdir
Create the remote directory PATH, over the FTP connection F.
@ftp/rmdir
Remove the remote directory PATH, over the FTP connection F.
urlread
Download a remote file specified by its URL and return its content in string S.
urlwrite
Download a remote file specified by its URL and save it as LOCALFILE.
base64_encode
Encode a double matrix or array X into the base64 format string S.
base64_decode
Decode the double matrix or array X from the base64 encoded string S.

Controlling Subprocesses

system
Execute a shell command specified by STRING.
unix
Execute a system command if running under a Unix-like operating system, otherwise do nothing.
dos
Execute a system command if running under a Windows-like operating system, otherwise do nothing.
open
Open the file FILE in Octave or in an external application based on the file type as determined by the filename extension.
perl
Invoke Perl script SCRIPTFILE, possibly with a list of command line arguments.
python
Invoke Python script SCRIPTFILE, possibly with a list of command line arguments.
popen
Start a process and create a pipe.
pclose
Close a file identifier that was opened by 'popen'.
popen2
Start a subprocess with two-way communication.
EXEC_PATH
Query or set the internal variable that specifies a colon separated list of directories to append to the shell PATH when executing external programs.
fork
Create a copy of the current process.
exec
Replace current process with a new process.
pipe
Create a pipe and return the reading and writing ends of the pipe into READ_FD and WRITE_FD respectively.
dup2
Duplicate a file descriptor.
waitpid
Wait for process PID to terminate.
WCONTINUE
Return the numerical value of the option argument that may be passed to 'waitpid' to indicate that it should also return if a stopped child has been resumed by delivery of a 'SIGCONT' signal.
WCOREDUMP
Given STATUS from a call to 'waitpid', return true if the child produced a core dump.
WEXITSTATUS
Given STATUS from a call to 'waitpid', return the exit status of the child.
WIFCONTINUED
Given STATUS from a call to 'waitpid', return true if the child process was resumed by delivery of 'SIGCONT'.
WIFSIGNALED
Given STATUS from a call to 'waitpid', return true if the child process was terminated by a signal.
WIFSTOPPED
Given STATUS from a call to 'waitpid', return true if the child process was stopped by delivery of a signal.
WIFEXITED
Given STATUS from a call to 'waitpid', return true if the child terminated normally.
WNOHANG
Return the numerical value of the option argument that may be passed to 'waitpid' to indicate that it should return its status immediately instead of waiting for a process to exit.
WSTOPSIG
Given STATUS from a call to 'waitpid', return the number of the signal which caused the child to stop.
WTERMSIG
Given STATUS from a call to 'waitpid', return the number of the signal that caused the child process to terminate.
WUNTRACED
Return the numerical value of the option argument that may be passed to 'waitpid' to indicate that it should also return if the child process has stopped but is not traced via the 'ptrace' system call
fcntl
Change the properties of the open file FID.
kill
Send signal SIG to process PID.
SIG
Return a structure containing Unix signal names and their defined values.

Process, Group, and User IDs

getpgrp
Return the process group id of the current process.
getpid
Return the process id of the current process.
getppid
Return the process id of the parent process.
geteuid
Return the effective user id of the current process.
getuid
Return the real user id of the current process.
getegid
Return the effective group id of the current process.
getgid
Return the real group id of the current process.

Environment Variables

getenv
Return the value of the environment variable VAR.
setenv
Set the value of the environment variable VAR to VALUE.
unsetenv
Delete the environment variable VAR.
get_home_directory
Return the current home directory.

Current Working Directory

cd
Change the current working directory to DIR.
ls
List directory contents.
ls_command
Query or set the shell command used by Octave's 'ls' command.
dir
Display file listing for directory DIRECTORY.
pwd
Return the current working directory.

Password Database Functions

getpwent
Return a structure containing an entry from the password database, opening it if necessary.
getpwuid
Return a structure containing the first entry from the password database with the user ID UID.
getpwnam
Return a structure containing the first entry from the password database with the user name NAME.
setpwent
Return the internal pointer to the beginning of the password database.
endpwent
Close the password database.

Group Database Functions

getgrent
Return an entry from the group database, opening it if necessary.
getgrgid
Return the first entry from the group database with the group ID GID.
getgrnam
Return the first entry from the group database with the group name NAME.
setgrent
Return the internal pointer to the beginning of the group database.
endgrent
Close the group database.

System Information

computer
Print or return a string of the form CPU-VENDOR-OS that identifies the type of computer that Octave is running on.
uname
Return system information in the structure.
nproc
Return the current number of available processors.
ispc
Return true if Octave is running on a Windows system and false otherwise.
isunix
Return true if Octave is running on a Unix-like system and false otherwise.
ismac
Return true if Octave is running on a Mac OS X system and false otherwise.
isieee
Return true if your computer _claims_ to conform to the IEEE standard for floating point calculations.
isdeployed
Return true if the current program has been compiled and is running separately from the Octave interpreter and false if it is running in the Octave interpreter.
isstudent
Return true if running in the student edition of MATLAB.
OCTAVE_HOME
Return the name of the top-level Octave installation directory.
matlabroot
Return the name of the top-level Octave installation directory.
OCTAVE_VERSION
Return the version number of Octave as a string.
version
Get version information for Octave.
ver
Display a header containing the current Octave version number, license string, and operating system.
compare_versions
Compare two version strings using the given OPERATOR.
license
Get license information for Octave and Octave packages.
getrusage
Return a structure containing a number of statistics about the current Octave process.

Hashing Functions

hash
Calculate the hash value of the string STR using the hash function HFUN.

Installing and Removing Packages

pkg
Manage or query packages (groups of add-on functions) for Octave.

Creating Packages

missing_component_hook
Query or set the internal variable that specifies the function to call when a component of Octave is missing.

Oct-Files

mkoctfile
The 'mkoctfile' function compiles source code written in C, C++, or Fortran.

Mex-Files

mex
Compile source code written in C, C++, or Fortran, to a MEX file.
mexext
Return the filename extension used for MEX files.

Java Interface

javaObject
Create a Java object of class CLASSSNAME, by calling the class constructor with the arguments ARG1, ...
javaArray
Create a Java array of size SZ with elements of class CLASSNAME.
isjava
Return true if X is a Java object.
java_get
Get the value of the field NAME of the Java object OBJ.
java_set
Set the value of the field NAME of the Java object OBJ to VAL.
javaMethod
Invoke the method METHODNAME on the Java object OBJ with the arguments ARG1, ....
javaclasspath
Return the class path of the Java virtual machine in the form of a cell array of strings.
javaaddpath
Add CLSPATH to the dynamic class path of the Java virtual machine.
javarmpath
Remove CLSPATH from the dynamic class path of the Java virtual machine.
javachk
Check for the presence of the Java FEATURE in the current session and print or return an error message if it is not.
usejava
Return true if the Java element FEATURE is available.
javamem
Show the current memory usage of the Java virtual machine (JVM) and run the garbage collector.
java_matrix_autoconversion
Query or set the internal variable that controls whether Java arrays are automatically converted to Octave matrices.
java_unsigned_autoconversion
Query or set the internal variable that controls how integer classes are converted when 'java_matrix_autoconversion' is enabled.
debug_java
Query or set the internal variable that determines whether extra debugging information regarding the initialization of the JVM and any Java exceptions is printed.

Test Functions

test
Perform built-in self-tests from the first file in the loadpath matching NAME.
assert
Produce an error if the specified condition is not met.
fail
Return true if CODE fails with an error message matching PATTERN, otherwise produce an error.

Demonstration Functions

demo
Run example code block N associated with the function NAME.
example
Display the code for example N associated with the function NAME, but do not run it.
rundemos
Execute built-in demos for all m-files in the specified DIRECTORY.
runtests
Execute built-in tests for all m-files in the specified DIRECTORY.
speed
Determine the execution time of an expression (F) for various input values (N).

Keywords

iskeyword
Return true if NAME is an Octave keyword.

Parser

add_input_event_hook
Add the named function or function handle FCN to the list of functions to call periodically when Octave is waiting for input.
remove_input_event_hook
Remove the named function or function handle with the given identifier from the list of functions to call periodically when Octave is waiting for input.
missing_function_hook
Query or set the internal variable that specifies the function to call when an unknown identifier is requested.

Package: octave