[go to previous section]

19. Reference

There are many MATLAB features which cannot be included in these introductory notes. Listed below are some of the MATLAB functions and operators available, grouped by subject area. [Source: MATLAB User's Guide, version 3.5] Use the on-line help facility or consult the User's Guide for more detailed information on the functions.

There are many functions beyond these. There exist, in particular, several "toolboxes" of functions for specific areas; included among such are signal processing, control systems, robust-control, system identification, optimization, splines, chemometrics, mu-analysis and synthesis, state-space identification, and neural networks. [The toolboxes, which are optional, may not be installed on your system.] These can be explored via the command help.

[Note: Some of the following tables require a tables-aware browser, such as Netscape 1.1N or later. - Ed.]

General
helphelp facility
demorun demonstrations
wholist variables in memory
whatlist M-files on disk
sizerow and column dimensions
lengthvector length
clearclear workspace
computertype of computer
^Clocal abort
exitexit MATLAB
quitsame as exit

Matrix OperatorsArray Operators
+addition
-subtraction
*multiplication
/division
\left division
^power
'conjugate transpose
+addition
-subtraction
.*multiplication
./division
.\left division
.^power
.'transpose

Relational and Logical Operators
<less than
<=less than or equal
>greater than
>=greater than or equal
==equal
~=not equal
&and
|or
~not

Special Characters
=assignment statement
[used to form vectors and matrices
]see [
(arithmetic expression precedence
)see (
.decimal point
...continue statement to next line
,separate subscripts and function arguments
;end rows, suppress printing
%comments
:subscripting, vector generation
!execute operating system command

Special Values
ansanswer when expression not assigned
epsfloating point precision
pi3.14159...
i, jsqrt(-1)
infinfinity
NaNNot-a-Number
clockwall clock
datedate
flopsfloating point operation count
narginnumber of function input arguments
nargoutnumber of function output arguments

Disk Files
chdirchange current directory
deletedelete file
diarydiary of the session
dirdirectory of files on disk
loadload variables from file
savesave variables to file
typelist function or file
whatshow M-files on disk
fprintfwrite to a file
packcompact memory via save

Special Matrices
compancompanion
diagdiagonal
eyeidentity
galleryesoteric
hadamardHadamard
hankelHankel
hilbHilbert
invhilbinverse Hilbert
linspacelinearly spaced vectors
logspacelogarithmically spaced vectors
magicmagic square
meshdomdomain for mesh points
onesconstant
pascalPascal
randrandom elements
toeplitzToeplitz
vanderVandermonde
zeroszero

Matrix Manipulation
rot90rotation
fliplrflip matrix left-to-right
flipudflip matrix up-to-down
diagdiagonal matrices
trillower triangular part
triuupper triangular part
reshapereshape
.'transpose
:convert matrix to single column; A(:)

Relational and Logical Functions
anylogical conditions
alllogical conditions
findfind array indices of logical values
isnandetect NaNs
finitedetect infinities
isemptydetect empty matrices
isstrdetect string variables
strcmpcompare string variables

Control Flow
ifconditionally execute statements
elseifused with if
elseused with if
endterminate if, for, while
forrepeat statements a number of times
whiledo while
breakbreak out of for and while loops
returnreturn from functions
pausepause until key pressed

Programming and M-Files
inputget numbers from keyboard
keyboardcall keyboard as M-file
errordisplay error message
functiondefine function
evalinterpret text in variables
fevalevaluate function given by string
echoenable command echoing
existcheck if variables exist
casesenset case sensitivity
globaldefine global variables
startupstartup M-file
getenvget environment string
menuselect item from menu
etimeelapsed time

Text and Strings
absconvert string to ASCII values
evalevaluate text macro
num2strconvert number to string
int2strconvert integer to string
setstrset flag indicating matrix is a string
sprintfconvert number to string
isstrdetect string variables
strcompcompare string variables
hex2numconvert hex string to number

Command Window
clc clear command screen
home move cursor home
format set output display format
disp display matrix or text
fprintfprint formatted number
echo enable command echoing

Graph Paper
plot linear X-Y plot
loglog loglog X-Y plot
semilogxsemi-log X-Y plot
semilogysemi-log X-Y plot
polar polar plot
mesh 3-dimensional mesh surface
contour contour plot
meshdomdomain for mesh plots
bar bar charts
stairs stairstep graph
errorbar add error bars

Graph Annotation
title plot title
xlabel x-axis label
ylabel y-axis label
grid draw grid lines
text arbitrarily position text
gtext mouse-positioned text
ginput graphics input

Graph Window Control
axis manual axis scaling
hold hold plot on screen
shg show graph window
clg clear graph window
subplotsplit graph window

Graph Window Hardcopy
print send graph to printer
prtsc screen dump
meta graphics metafile

Elementary Math Functions
abs absolute value or complex magnitude
angle phase angle
sqrt square root
real real part
imag imaginary part
conj complex conjugate
round round to nearest integer
fix round toward zero
floor round toward $-\infty$
ceil round toward $\infty$
sign signum function
rem remainder
exp exponential base e
log natural logarithm
log10 log base 10

Trigonometric Functions
sin sine
cos cosine
tan tangent
asin arcsine
acos arccosine
atan arctangent
atan2 four quadrant arctangent
sinh hyperbolic sine
cosh hyperbolic cosine
tanh hyperbolic tangent
asinh hyperbolic arcsine
acosh hyperbolic arccosine
atanh hyperbolic arctangent

Special Functions
bessel bessel function
gamma gamma function
rat rational approximation
erf error function
inverfinverse error function
ellipkcomplete elliptic integral of first kind
ellipjJacobian elliptic integral

Decompositions and Factorizations
balance balanced form
backsub backsubstitution
cdf2rdf convert complex-diagonal to real-diagonal
chol Cholesky factorization
eig eigenvalues and eigenvectors
hess Hessenberg form
inv inverse
lu factors from Gaussian elimination
nnls nonnegative least squares
null null space
orth orthogonalization
pinv pseudoinverse
qr orthogonal-triangular decomposition
qz QZ algorithm
rref reduced row echelon form
schurSchur decomposition
svd singular value decomposition

Matrix Conditioning
cond condition number in 2-norm
norm 1-norm,2-norm,F-norm,$\infty$-norm
rank rank
rcondcondition estimate (reciprocal)

Elementary Matrix Functions
expm matrix exponential
logm matrix logarithm
sqrtmmatrix square root
funm arbitrary matrix function
poly characteristic polynomial
det determinant
trace trace
kron Kronecker tensor product

Polynomials
poly characteristic polynomial
roots polynomial roots---companion matrix method
roots1 polynomial roots---Laguerre's method
polyvalpolynomial evaluation
polyvalmmatrix polynomial evaluation
conv multiplication
deconv division
residuepartial-fraction expansion
polyfitpolynomial curve fitting

Column-wise Data Analysis
max maximum value
min minimum value
mean mean value
medianmedian value
std standard deviation
sort sorting
sum sum of elements
prod product of elements
cumsumcumulative sum of elements
cumprodcumulative product of elements
diff approximate derivatives
hist histograms
corrcoef correlation coefficients
cov covariance matrix
cplxpair reorder into complex pairs

Signal Processing
abs complex magnitude
angle phase angle
conv convolution
corrcoef correlation coefficients
cov covariance
deconvdeconvolution
fft radix-2 fast Fourier transform
fft2 two-dimensional FFT
ifft inverse fast Fourier transform
ifft2 inverse 2-D FFT
fftshiftFFT rearrangement

Numerical Integration
quad numerical function integration
quad8 numerical function integration

Differential Equation Solution
ode23 2nd/3rd order Runge-Kutta method
ode45 4th/5th order Runge-Kutta-Fehlberg method

Nonlinear Equations and Optimization
fmin minimum of a function of one variable
fmins minimum of a multivariable function
fsolve solution of a system of nonlinear equations
(zeros of a multivariable function)
fzero zero of a function of one variable

Interpolation
spline cubic spline
table1 1-D table look-up
table2 2-D table look-up


[return to Table of Contents]