This appendix is not exhaustive; it lists most of the MATLAB commands and functions used in the text, as well as a few more.
For a complete list by category (with links to detailed descriptions) see the online documentation MATLAB: Reference: MATLAB Function Reference: Functions by Category.
The command help by itself displays a list of all the function categories (each in its own directory):
B.1 General purpose commands
B.1.1 Managing commands
demo
Run demos
help
Online help
helpwin
Display categories of functions with links to each category
lookfor
Keyword search through help entries
type
List M-file
what
Directory listing of M- and MAT-files
which
Locate functions and files
B.1.2 Managing variables and the workspace
clear
Clear variables and functions from memory
disp
Display matrix or text
length
Length of a vector
load
Retrieve variables from disk
save
Save workspace variables to disk
size
Array dimensions
who, whos
List variables in the workspace
B.1.3 Files and the operating system
beep
Produce a beep sound
cd
Change current working directory
delete
Delete file
diary
Save text of MATLAB session
dir
Directory listing
edit
Edit an M-file
!
Execute operating system command
B.1.4 Controlling the Command Window
clc
Clear Command Window
echo
Echo commands in script
format
Set output format for disp
home
Send cursor home
more
Control paged output
B.1.5 Starting and quitting MATLAB
exit
Terminate MATLAB
quit
Terminate MATLAB
startup
M-file executed when MATLAB starts
B.2 Logical functions
all
True if all elements of vector are true (non-zero)
any
True if any element of vector is true
exist
Check if variable or file exists
find
Find indices of non-zero elements
is*
Detect various states
logical
Convert numeric values to logical
B.3 Language constructs and debugging
B.3.1 MATLAB as a programming language
error
Display error message
eval
Interpret string containing MATLAB expression
feval
Function evaluation
for
Repeat statements a specific number of times
global
Define global variable
if
Conditionally execute statements
persistent
Define persistent variable
switch
Switch among several cases
try
Begin try block
while
Repeat statements conditionally
B.3.2 Interactive input
input
Prompt user for input
keyboard
Invoke keyboard as a script file
menu
Generate menu of choices for user input
pause
Wait for user response
B.4 Matrices and matrix manipulation
B.4.1 Elementary matrices
eye
Identity matrix
linspace
Vector with linearly spaced elements
ones
Matrix of ones
rand
Uniformly distributed random numbers and arrays
randn
Normally distributed random numbers and arrays
zeros
Matrix of zeros
: (colon)
Vector with regularly spaced elements
B.4.2 Special variables and constants
B.4.3 Time and date
calendar
Calendar
clock
Wall clock (complete date and time)
date
You’d never guess
etime
Elapsed time
tic, toc
Stopwatch
weekday
Day of the week
B.4.4 Matrix manipulation
cat
Concatenate arrays
diag
Create or extract diagonal
fliplr
Flip in left/right direction
flipud
Flip in up/down direction
repmat
Replicate and tile an array
reshape
Change shape
rot90
Rotate 90°
tril
Extract lower tridiagonal part
triu
Extract upper tridiagonal part
B.4.5 Specialized matrices
gallery
Test matrices
hilb
Hilbert matrix
magic
Magic square
pascal
Pascal matrix
wilkinson
Wilkinson’s eigenvalue test matrix
B.5 Mathematical functions
abs
Absolute value
acos, acosh
Inverse cosine and inverse hyperbolic cosine
acot, acoth
Inverse cotangent and inverse hyperbolic cotangent
acsc, acsch
Inverse cosecant and inverse hyperbolic cosecant
angle
Phase angle
asec, asech
Inverse secant and inverse hyperbolic secant
asin, asinh
Inverse sine and inverse hyperbolic sine
atan, atanh
Inverse tangent (two quadrant) and inverse hyperbolic tangent
atan2
Inverse tangent (four quadrant)
bessel
Bessel function
ceil
Round up
conj
Complex conjugate
cos, cosh
Cosine and hyperbolic cosine
cot, coth
Cotangent and hyperbolic cotangent
csc, csch
Cosecant and hyperbolic cosecant
erf
Error function
exp
Exponential
fix
Round toward zero
floor
Round down
gamma
Gamma function
imag
Imaginary part
log
Natural logarithm
log2
Dissect floating point numbers into exponent and mantissa
log10
Common logarithm
mod
Modulus (signed remainder after division)
rat
Rational approximation
real
Real part
rem
Remainder after division
round
Round toward nearest integer
sec, sech
Secant and hyperbolic secant
sign
Signum function
sin, sinh
Sine and hyperbolic sine
sqrt
Square root
tan, tanh
Tangent and hyperbolic tangent
B.6 Matrix functions
det
Determinant
eig
Eigenvalues and eigenvectors
expm
Matrix exponential
inv
Matrix inverse
poly
Characteristic polynomial
rank
Number of linearly independent rows or columns
rcond
Condition estimator
trace
Sum of diagonal elements
{} and/
Linear equation solution
B.7 Data analysis
cumprod
Cumulative product
cumsum
Cumulative sum
diff
Difference function
fft
One-dimensional fast Fourier transform
max
Largest element
mean
Average value of elements
median
Median value of elements
min
Smallest element
prod
Product of elements
sort
Sort into ascending order
std
Standard deviation
sum
Sum of elements
trapz
Trapezoidal rule for numerical integration
B.8 Polynomial functions
polyfit
Fit polynomial to data
polyval
Evaluate polynomial
roots
Find polynomial roots
B.9 Function functions
bvp4c
Solve two-point boundary value problems for ODEs
fmin
Minimize function of one variable
fmins
Minimize function of several variables
fzero
Find zero of function of one variable
ode23, ode23s, ode45
Solve initial value problems for ODEs
quad
Numerical integration
B.10 Sparse matrix functions
full
Convert sparse matrix to full matrix
sparse
Construct sparse matrix from non-zeros and subscripts