8/10/2019 Matlab Help Text
1/62
matlab-help-text
asec
CSC
acsc
cot
acot
exp
log
log i c
sqrt
abs
angle
conj
imag
real
fix
floor
ceil
round
mod
rem
sign
norm
rank
det
expm
logm
sqrtm
max
min
mean
median
std
sort
sortrows
sum
prod
hist
diff
gradient
f f t
plot
ioglog -
semilogx -
semilogy -
polar
plotyy
Inverse Secant.
Cosecant.
Inverse Cosecant.
Cotangent.
Inverse Cotangent.
Exponential.
Natural logarithm.
- Common (base 10) logarithm.
Square root.
Absolute value.
Phase angle.
complex conjugate.
complex imaginary part.
complex real part.
Round towards zero.
Round towards Minus Infinity.
Round towards Plus Infinity.
Round towards nearest Integer.
- Modulus (signed remainder after division).
remainder after division.
Signum.
Matrix or vector norm.
Matrix rank.
Determinant.
Matrix Exponential.
Matrix logarithm.
Matrix Square root.
Largest component.
Smallest component.
Average or mean value.
Median value.
Standard deviation.
Sort in ascendingorder.
Sort rows in ascendingorder.
Sum of elements.
product of elements.
Histogram.
Difference and approximate derivative.
approximate gradient.
Discrete Fourier transform.
Linear plot.
Log-log scale plot.
Semi-log scale plot.
Semi-log scale plot.
Polar coordinate plot.
Graphs with y tick labels on the left and right.
Page 2
8/10/2019 Matlab Help Text
2/62
matlab-help-text
axis
zoom
grid
legend -
title
xiabel -
ylabel -
mesh
surf
fills
colormap
figure
Control axis scaling an d appearance.
- Zoom in and out on a 2-D plot.
Grid lines.
Graph legend.
Graph title.
X-axis label.
Y-axis label.
3-D mesh surface.
3-D colored surface.
- Filled 3-D polygons.
Color look-up table.
Create figure window.
axes i Create axes.
char - Create character array (string).
strcat
num2str
int2str
fopen
fclose
fread
fwri te
fscanf
fprintf
fget l
fgets
input
cIc
home
pause
now
date
clock
abs
what
lookfor
which
path
echo
more
diary
format
delete
if
else
elseif
Concatenate strings.
Convert number to string. j
Convert integer to string. '
Open file.
Close file.
Read binary data from file.
Write binary data to file.
Read formatted data from file.
Write formatted data to file.
Read line from file, discard newline character.
Read line from file, keep newline character.
Prompt for user input.
Clear command window.
Send cursor home.
Wait for user response.
current date and time as date number.
current date as date string.
current date and time as datevector.
Magnitude.
List MATI^B-specific files in directory.
Search allM-filesfor keyword.
Locate functions and files.
Get/set Search path.
Echo commands inM-files.
Control paged output in command window.
Save text of MATLAB session.
set output format.
Delete file.
Conditionally Execute statements.
if statement condition.
if statement condition.
end 1 Terminate scope of for, WHILE, SWITCH and if statements.
Page 3
8/10/2019 Matlab Help Text
3/62
matlab-help-text
for
while
break
switch
case
otherwise
return
reshape
flipdim
rot90
find
end
eps
realmax
realmin
why
Repeat statements a specific number of times.
Repeat statements an indefinite number of times.
Terminate execution of WHILE or for loop.
SWITCH am ong several cases based On expression.
SWITCH statement case.
Default SWITCH statement case.
return to invoking function.
Change size.
Flip Matrix along specified dimension.
- Rotate matrix 90 degrees.
Find indices of nonzero elements.
Last index.
floating point relative accuracy.
Largest positive floating point number.
Smallest positive floating point number.
Succinct answer.
sinh j Hyperbolic Sine.
asinh
cosh
acosh
tanh
atanh
sech
asech
csch
acsch
coth
acoth
log2
pow2
nextpow2
cumsum
cumprod
corrcoef
cov
f f t2
f f tn
roots
residue
conv
deconv
double
sprintf
sscanf
demo
ver
Inverse Hyperbolic Sine.
Hyperbolic Cosine.
Inverse Hyperbolic Cosine.
Hyperbolic Tangent.
Inverse Hyperbolic Tangent.
Hyperbolic Secant.
Inverse Hyperbolic Secant.
Hyperbolic Cosecant.
Inverse Hyperbolic Cosecant.
Hyperbolic Cotangent. '
Inverse Hyperbolic Cotangent. \
- Base 2 logarithm and dissect floating point number.
- Base 2 power and scale floating point number.
- Next higher power of 2. |
Cumulative Sum of elements. i
Cumulative product of elements.
Correlation coefficients. j
Covariance matrix.
two-dimensional Discrete Fourier transform.
N-dimensional
Discrete Fourier transform.
Find Polynomial roots.
- Partial-fraction expansion (residues).
multiply polynomials.
divide polynomials.
Convert string to numeric character codes.
Write formatted data to string.
Read string under format control.
Run demonstrations.
MATLAB, SIMULINK, and toolbox version inforn
L_
lation.
Page 4
8/10/2019 Matlab Help Text
4/62
matlab-help-text
addpath
rmpath
editpath
dos
Unix
vms
fliplr
Add directory to Search
path.
1
Remove directory from Search path.
Modify Search path.
Execute operating system command.
Execute DOS command and return result.
Execute UNIX command and return result.
Execute VMS DCL command and return result.
Flip Matrix in left/right direction.
flipud Flip Matrix in up/down direction.
pack Consolidate workspace memory.
Pages
8/10/2019 Matlab Help Text
5/62
General information
Managing the workspace.
Managing commands anci functions.
Managing the search path
Controlling the command window.
Operating system commands
Debugging M-files.
Profiling M-files.
Operators and special characters.
Arithmetic operators.
Relational operators.
Logical operators.
Special characters.
Bitwise operators.
Set operators.
^^'?ff'^*"*""ina language constructs.
Control flow.
Evaluation and execution.
Scripts, functions, and variables.
Argument handling.
Message display.
Interactive input.
Elementary matrices and matrix manipulation.
Elementary inatrices.
Basic array information.
Matrix manipulation.
Special variables and constants.
Specialized matrices.
Elementary math functions.
Trigonometric.
Exponential.
Complex.
Rounding and remainder.
Specialized math functions.
Specialized math functions.
Number theoretic functions.
Coordinate transforms.
M a t r i x f u n c t i o n s - T^niperical l i n e a r a l g e b r a .
Matrix analysis.
Linear ecjuations.
Eigenvalues and singular values.
Matrix functions.
Factorization utilities
Data analysis and Fourier transforms.
Basic operations.
Finite differences.
Correlation.
Filtering and convolution.
Fourier transforms.
Sound and audio.
Audio file inport/export.
Interpolation and polynomials.
Data interpolation.
Spline interpolation.
Geometric analysis.
Polynomials.
8/10/2019 Matlab Help Text
6/62
Function functions and ODE solvers.
Optimization and root finding.
Numerical integration cjuadrature).
Plotting.
Inline function object.
Ordinary differential ecjuation solvers.
ODE Option handling.
ODE output functions.
Sparse matrices.
Elementary sparse matrices.
Full to sparse conversion.
Working with sparse matrices.
Reordering algorithms.
Linear algebra.
Linear Equations (iterativemethods).
Operations on graphs
(trees).
Miscellaneous.
Two dimensional graphs.
Elementary X-Y graphs.
Axis control.
Graph anno ta t ion.
Hardcopy and printing.
Three dimensional graphs.
Elementary 3-D plots.
Color control.
Lighting.
Color maps.
Axis control.
Viewpoint control.
Graph annotation.
Hardcopy and printing.
Specialized graphs.
Specialized 2-D graphs.
Contour and 2-1/2 D graphs.
Specialized 3-D graphs.
Images display and file I/O.
Movies and animation.
Color related functions.
Solid modeling.
Handle Graphics.
Figure window creation and control.
Axis creation and control.
Handle Graphics objects.
Handle Graphics operations.
Hardcopy and printing.
Utilities.
Graphical user interface tools.
GUI functions.
GUI design tools.
Dialog boxes.
Menu utilities.
Toolbar button group utilities.
User-defined figure/axes property utilities.
Miscellaneous utilities.
Character strings.
General.
String tests.
String operations.
String to number conversion.
Basen\imberconversion.
8/10/2019 Matlab Help Text
7/62
File input/outPut.
File openingandclosing.
Binary fileI/O.
Formatted fileI/O.
String conversion.
File positioning.
File name handling
File import/export functions.
Image file import/export.
Audio file import/export.
Command windowI/O
Time
and
dates.
Current dateandtime.
Basic functions.
Date functions.
Timing functions.
Data types
and
structures.
Data types (classes)
Multi-dimensional array functions.
Cell array functions.
Structure functions.
Object oriented programming functions.
Overloadable operators.
Signal Processing Toolbox
Waveform generation.
Filter analysisandimplementation.
Linear system transformations.
IIR digital filter design.
IIR filter order selection.
FIR filter design.
Transforms.
Statistical signal processingandspectral analysis.
Windows.
Parametric modeling.
Specialized operations.
Analog lowpass filter prototypes.
Freciuency translation.
Filter discretization.
Other.
SignalGUI(Graphical UserInterface).
Demonstrations.
P ym T nr ^\ C M a t h T O O l b O X .
C a l c u l u s .
Linear Algebra.
Simplification.
SolutionofEcjuations.
Variable Precision Arithmetic.
Integral Transforms.
Conversions.
Basic Operations.
Special Functions.
String handling utilities.
PedagogicalandGraphical Applications.
Demonstrations.
Access
to
Maple.
(Not
available with Student Edition.)
8/10/2019 Matlab Help Text
8/62
General purpose c'?"""""' '*
MATLAB Toolbox Versio n 5.0 Student Edition 31-Dec-1996
General information
help - On-line help, display text at command line.
helpwin - On-line help, separate window for navigati on.
helpdesk - Comprehensi ve hypertext documentati on and troublesho oting.
demo - Run demonstrat ions.
ver - MATLAB, SIMULINK, and toolbox version information.
whatsn ew - Display Readme files.
Readme -
What'
s new in MATLAB
5 .
Managing the workspace.
who - List current variab les.
whos - List current variab les, long form.
clear - Clear variables and functions from memory.
pack - Consolidate workspace memory.
load - Load workspace variables from disk.
save - Save workspac e variables to disk.
ciuit - Quit MATLAB sessi on.
Managing commands and functions.
what - List MATLAB-specific files in directory.
type - List M-file.
edit - Edit M-file.
lookfor - Search all M-files for keyword.
which - Locate functions and files.
pcode - Create pre-parsed pseudo-code file (P-file)
inmem - List functions in memory.
mex - Compile MEX-functio n.
Managing the search path
path - Get/set search path,
addpath - Add directory to search path ,
rmpath - Remove directory from search path ,
editpath - Modify search path.
Controlling the command window.
echo - Echo commands in M-file s.
more - Control paged output in command window .
diary - Save text of MATLAB session.
format - Set output format.
Operating system commands
cd - Change current working directory.
pwd - Show (print) current working directory.
dir - List directory.
delete - Delete file.
getenv - Get environment variable.
- Execute operating system command.
dos - Execute DOS command and return result.
Unix - Execute UNIX command and return result.
vms - Execute VMS DCL command and return result.
web - Open Web browser on site or files.
computer - Computer type.
Debugging M-files.
debug - List debugging command s.
dbstop - Set breakpoi nt.
(Sbclear - Remove brea kpoint.
dbcont - Continue execution.
dbdovm - Change local workspace context.
cibstack - Displ ay function call stack .
dbstatus - List all brea]cpoints.
dbstep - Execute one or more lines.
dbtype - List M-file with line number s.
dbup - Change local workspac e context.
dlxjuit - Quit debug mod e.
dbmex - Debug MEX-files (UNIX only).
Profiling M-files.
profil e - Profile M-file execution time.
8/10/2019 Matlab Help Text
9/62
Operators and special characters.
Arithmetic
plus
uplus
minus
uminus
mtimes
times
mpower
power
mldivide
mrdivide
Idivide
rdivide
kron
Relational
eq
ne
It
gt
le
ge
operators.
-
-
-
-
-
-
-
-
-
-
-
-
-
Plus
Unary plus
Minus
Unary minus
Matrix multiply
Array multiply
Matrix power
Array power
Backslash or left matrix divide
Slash or right matrix divide
Left array divide
Right array divide
Kronecker tensor product
operators.
-
-
-
-
-
-
Eciual
Not equal
Less than
Greater than
Less than or ecjual
Greater than or eciual
+
+
-
-
.
*
/v
A
'\
/
.\
./
kron
==
~=
< =
> =
Logical operators.
and - Logical AND &
or - Logical OR |
not - Logical NOT
xor - Logical EXCLUSIVE OR
any - True if any element of vector is nonzero
all - True if all elements of vector are nonzero
Special characters.
colon
par en
paren
paren
paren
paren
punct
punct
punct
punct
punct
punct
punct
punct
pxinct
punct
transpose
ctranspose
horzcat
vertcat
subsasgn
subsref
subsindex
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Colon
Parentheses and subscripting (
Parentheses and siibscripting (
Brackets [
Braces and subscripting {
Braces and subscripting {
Decimal point
Structure field access
Parent directory
Continuation
Separator
Semicolon
Comment
i
Invoke operating system command
Assignment =
Quote
Transpose
Complex conjugate transpose
Horizontal concatenation [
Vertical concatenation [
Subscripted assignment ( )
Subscripted reference ( )
Subscript index
Bitwise operators.
bitand
bitcmp
bitor
bitmax
bitxor
bitset
bitget
bitshift
-
-
-
-
-
-
-
-
Set operators.
union
unique
intersect
setdiff
setxor
ismerrODer
-
-
-
-
-
-
Bit-wise AND.
Complement
bits.
Bit-wise OR.
Maximum floating point integer.
Bit-wise XOR.
Set bit.
Get bit.
Bit-wise shift.
Set union.
Set unicjue.
Set intersection.
Set difference.
Set exclusive-or.
True for set member.
:
1
]
{ )
{ }
See also ARITH, RELOP, SLASH.
8/10/2019 Matlab Help Text
10/62
Programming language constructs.
Control flow.
if - Conditionally execute statements.
else - IF statement condition.
elseif - IF statement condition.
end - Terminate scope of FOR, WHILE, SWITCH and IF stateme nts.
for - Repeat statements a specific number of times.
while - Repeat statements an indefinite number of times.
break - Terminate execution of WHILE or FOR loop.
switch - Switch among several cases based on expressi on.
case - SWITCH statement case.
otherwise - Default SWITCH statement case.
return - Return to invoking function.
Evaluation and execution.
eval
feval
evalin
builtin
assignin
run
- Execute string with MATLAB expression.
- Execute function specified by string.
- Evaluate expression in workspac e.
- Execute built-in function from overloaded method.
- Assign variable in workspace.
- Run script.
Scripts,
functions, and variables.
script - About MATLAB scripts and M-fil es.
function - Add new function.
global - Define global variabl e.
mfilename - Name of currently executing M-fil e.
lists - Comma separated lists.
exist - Check if variables or functions are defined.
isglobal - True for global variab les.
Argument handling.
nargchk
nargin
nargout
varargin
varargout
inputname
Message display,
error
warning
lasterr
errortrap
disp
fprintf
sprintf
Validate number of input arguments.
Number of function input arguments.
Number of function output arguments.
Variable length input argument list.
Variable length output argument list.
Input argiiment name.
Display error message and abort function.
Display warning message.
Last error message.
Skip error during testing.
Display an array.
Display formatted message.
Write formatted data to a string.
Interactive input.
input - Prompt for user input.
keyboard - Invoke keyboard from M-fil e.
pause - Wait for user response,
uimenu - Create user interface menu,
uicontrol - Create user interface control .
8/10/2019 Matlab Help Text
11/62
Elementary matrices and matrix manipulation.
Elementary matrices.
zeros - Zeros array.
ones - Ones array.
eye - Identity matrix.
repmat - Replicate and tile array.
rand - Uniformly distributed random numbe rs.
randn - Normally distributed random numbers.
linspace - Linearly spaced vector.
logspace - Logarithmically spaced vector .
meshgrid - X and Y arrays for 3-D plot s.
: - Regularly spaced vector and index into matrix .
Basic array information.
size - Size of matrix.
length - Length of vector.
ndims - Number of dimensio ns.
disp - Display matrix or text.
iseinpty - True for empty matr ix.
isecpjal - True if arrays are ident ical.
isniimeric - True for numeric arrays.
islogical - True for logical array.
logical - Convert numeric values to logical.
Matrix manipulation.
reshape - Change size.
diag - Diagonal matrices and diagonals of matrix .
tril - Extract lower trieingular par t.
triu - Extract upper triangular part.
fliplr - Flip matrix in left/right direction .
flipud - Flip matrix in up/down direction.
flipdim - Flip matrix along specified dimension .
rot90 - Rotate matrix 90 degrees.
: - Regularly spaced vector and index into matrix .
find - Find indices of nonzero element s.
end - Last index.
sub2ind - Linear index from multiple subscri pts.
ind2sub - Multiple subscripts from linear index.
Special variables and constants.
ans - Most recent answer,
eps - Floating point relative accuracy,
realmax - Largest positiv e floating point numbe r,
realmin - Smallest positive floating point number ,
pi - 3.1415926535897.. ..
i, j - Imaginary unit,
inf - Infinity.
NaN - Not-a-Number.
isnan - True for Not-a-Nu mber.
isinf - True for infinite element s,
isfinite - True for finite elemen ts,
flops - Floating point operation count ,
why - Succinct answer.
Specialized matrices.
compan - Companion matrix.
gallery - Higham test matric es.
hadamard - Hadamard matrix.
hankel - Hankel matrix.
hilb - Hilbert matrix.
invhilb - Inverse Hilbert matrix.
magic - Magic scjuare.
pascal - Pascal matrix .
rosser - Classic symmetric eigenvalue test proble m.
toeplitz - Toeplitz matri x.
vander - Vandermonde matrix.
Wilkinson - Wilkinson's eigenvalue test matrix.
8/10/2019 Matlab Help Text
12/62
Elementary math functions.
Trigonometric.
sin - Sine.
sinh - Hyperbolic sine.
asin - Inverse sine.
asinh - Inverse hyperbolic sine.
cos - Cosine.
cosh - Hyperbolic cosine.
acos - Inverse cosine.
acosh - Inverse hyperbolic cosine.
tan - Tangent.
tanh - Hyperbolic tangent.
atan - Inverse tangent.
atan2 - Four cjuadrant inverse tangent.
atanh - Inverse hyperbolic tangent.
sec - Secant.
sech - Hyperbolic secant.
asec - Inverse secant.
asech - Inverse hyperbolic secant.
CSC - Cosecant.
csch - Hyperbolic cosecant.
acsc - Inverse cosecant.
acsch - Inverse hyperbolic cosecant.
cot - Cotangent.
coth - Hyperbolic cotangent.
acot - Inverse cotangent.
acoth - Inverse hyperbolic cotangent.
Exponential.
exp - Exponential.
log - Natural logarithm.
loglO - Common (base 10) logarithm.
log2 - Base 2 logarithm and dissect floating point number.
pow2 - Base 2 power and scale floating point number.
sqrt - Scjuare root.
nextpow2 - Next higher power of 2.
Complex.
abs - Absolute value.
angle - Phase angle.
conj - Complex conjugate.
imag - Complex imaginary part.
real - Complex real part.
unwrap - Unwrap phase angle.
isreal - True for real array.
cplxpair - Sort numbers into complex conjugate pairs.
Rounding and remainder.
fix - Round towards zero.
floor - Round towards minus infinity.
ceil - Round towards plus infinity.
round - Round towards nearest integer.
mod - Modulus (signed remainder afterdivision).
rem - Remainder after division.
sign - Signum.
8/10/2019 Matlab Help Text
13/62
Specialized math functions.
Specialized math functions,
airy - Airy functions.
besselj - Bessel function of the first kind,
bessely - Bessel function of the second kind.
besselh - Bessel functions of the third kind (Hankel function)
besseli - Modified Bessel function of the first kind,
besselk - Modified Bessel function of the second kind,
beta - Beta function,
betainc - Incomplete beta function,
betaln - Logarithm of beta function,
ellipj - Jacobi elliptic functions,
ellipke - Complete elliptic integral,
erf - Error function,
erfc - Complementary error function,
erfcx - Scaled complementary error function,
erfinv - Inverse error function,
expint - Exponential integral function,
gamma - Gamma function,
gammainc - Incomplete gamma function,
gammaln - Logarithm of gamma function.
legendre - Associated Legendre function,
cross - Vector cross produc t.
Number theoretic functions,
factor - Prime factors,
isprime - True for prime number s.
primes - Generate list of prime numbe rs,
gcd - Greatest common divisor.
1cm - Least common multip le,
rat - Rational approximat ion,
rats - Rational output.
perms - All possible permutations,
nchoosek - All combinations of N elements taken K at a time.
Coordinate transforms.
cart2sph - Transform Cartesian to spherical coordi nates.
cart2pol - Transform Cartesian to polar coordin ates.
pol2car t - Transform polar to Cartesian coordin ates.
sph2cart - Transform spherical to Cartesian coord inate s.
hsv2rg b - Convert hue-saturatio n-value colors to red-gre en-blue.
rgb2hsv - Convert red-green-blue colors to hue-sat uratio n-valu e.
8/10/2019 Matlab Help Text
14/62
Matrix functions - mimarical linear algebra.
Matrix analysis,
norm
normest
rank
det
trace
null
orth
rref
subspace
Matrix or vector norm.
Estimate the matrix
2-norm.
Matrix rank.
Determinant.
Sum of diagonal elements.
Null space.
Orthogonalization.
Reduced row echelon form.
Angle between two subspaces.
Linear ecjuations.
\ and /
inv
cond
condest
chol
choline
lu
luinc
qr
nnls
pinv
Iscov
Eigenvalues
eig
svd
eigs
svds
poly
polyeig
condeig
hess
qz
schur
Linear ecjuation solution; use "help slash" .
- Matrix inverse.
- Condition number with respect to inversion.
-1-norm condition number estimate.
- Cholesky factorization.
- Incomplete Cholesky factorization.
- LU factorization.
- Incomplete LU factorization.
- Orthogonal-triangular decomposition.
- Non-negative least-scjuares.
- Pseudoinverse.
- Least squares with knovm covariance.
and singular values.
- Eigenvalues and eigenvectors.
- Singular value decomposition.
- A few eigenvalues.
- A few singular values.
- Characteristic polynomial.
- Polynomial eigenvalue problem.
- Condition number with respect to eigenvalues.
- Hessenberg form.
- QZ factorization for generalized eigenvalues.
- Schur decomposition.
Matrix functions.
expm - Matrix exponentia l.
logm - Matrix logarithm.
sqrtm - Matrix scjuare root.
funm - Evaluate general matrix function.
Factorization utilities
qrdelete - Delete column from QR factorization.
qrinsert - Insert column in QR factorization.
rsf2csf - Real block diagonal form to complex diagonal form.
cdf2rdf - Complex diagonal form to real block diagonal form.
balance - Diagonal scaling to improve eigenvalue accuracy.
planerot - Given's plane rotation.
8/10/2019 Matlab Help Text
15/62
Data analysis andFourier transforms.
Basic operations.
max -Largest c omponent.
mi n -Smallest component.
mean
-
Average
or
mean value.
median -Median v alue.
std -Stanciard d eviation.
sort -Sortinascending order.
sortrows
-
Sort rows
in
ascending order.
sum - Sum ofelements.
prod -Productofelements.
hist -Histogram.
trapz -Trapezoidal num erical i ntegration.
cumsum -Cumulativesum ofelements.
cumprod -Cumulative productofelements.
cumtrapz -Cumulative trapezoicJal num erical integrati on.
Finite differences.
diff -Differenceandapproximate derivative,
gradient -Approximate gradient.
del2 -Discrete Laplacian.
Correlation,
corrcoef
cov
subspace
Correlation coefficients.
Covariance matrix.
Angle between subspaces.
Filtering
and
convolution.
filter -One-dimensional digital filter.
filter2 -Two-dimensiona l digital filter.
conv
-
Convolution
and
polynomial multiplication.
conv2 -Two-dimensional convolution.
convn -N-dimensional convolution .
deconv -Deconvolutionandpolynomial division.
Fourier transforms.
fft -Discrete Fourier transform.
fft2 -Two-dimensional discrete Fourier transform.
fftn -N-dimensional discrete Fourier T ransform.
ifft
-
Inverse discrete Fourier transform.
ifft2 -Two-dimensional inverse discrete Fourier transform.
ifftn -N-dimensiona l inverse discrete Fourier Transfo rm.
fftshift -Move zerothlag tocenterofspectrum.
Soundandaudio.
sound -Play vectorassound.
soundsc -Autoscaleandplay vectorassound.
speak -Convert input stringtospeech (Macintosh only).
recordsound -Record sound (Macintosh only).
soundcap -Sound capabilities (Macintosh
only).
mu21in -Convert mu-la w encodingtolinear signal.
Iin2mu -Convert linear signaltomu-law encoding.
Audio file inport/export.
auwrite -Write NeXT/SUN ( .au )sound file.
auread -Read NeXT/SUN ( .au )sound file,
wavwrite -Write Microsoft WAVE ( .wav )sound file.
wavread -Read Microsoft WAVE ( .wav )sound file,
readsnd
-
Read
SND
resources
and
files (Macintosh only).
writesnd -WriteSNDresourcesandfiles (Macintosh on ly)
8/10/2019 Matlab Help Text
16/62
Interpolation and polynomials.
Data interpolation.
interpl - 1-D interpolation (table
lookup).
interplq - Quick 1-D linear interpolation,
interpft - 1-D interpolation using FFT method.
interp2 - 2-D interpolation (table
lookup).
interp3 - 3-D interpolation (table loo)cup) .
interpn - N-D interpolation (table
lookup).
griddata - Data gridding and surface fitting.
Spline interpolation.
spline - Cubic spline interpolation,
ppval - Evaluate piecewise polynomial.
Geometric analysis,
delaunay
dsearch
tsearch
convhull
voronoi
inpolygon
rectint
polyarea
Polynomials.
roots
poly
polyval
polyvalm
residue
polyfit
polyder
conv
deconv
Delaunay triangulation.
- Search Delaunay triagulation for nearest point.
- Closest triangle search.
- Convex
hull.
- Voronoi diagram.
- True for points inside polygonal region.
- Rectangle intersection area.
- Area of polygon.
Find polynomial roots.
Convert roots to polyno mial.
Evaluate polynomial.
Evaluate polynomial with matrix arcfument.
Partial-fraction expansion (residues).
Fit polynomial to data.
Differentiate polynomial.
Multiply polynomials.
Divide polynomials.
8/10/2019 Matlab Help Text
17/62
Function functions and ODE solvers.
optimization and root finding.
fmin - Minimiz e function of one varia ble,
fmins - Minimize function of several vari ables ,
fzero - Find zero of function of one variab le.
Numerica l integratio n (cjuadrature) .
cjuad - Numericall y evaluate integral, low order method.
quad8 - Numericall y evaluate integral, higher order method.
cJblcjuad - Nume rica lly evaluate double integral.
Plotting,
ezplot
fplot
- Easy to use function plotter.
- Plot function.
Inline function object.
inline - Construct INLINE object.
argnames - Argument neimes.
formula - Function formula.
char - Convert INLINE object to character array.
Ordinary differential ecjuation solvers.
(If unsure about stiffness, try ODE45 first, then 0DE15S.)
ode45 - Solve non-stiff differential ecjuations, medium order method.
ode23 - Solve non-stiff differential ecjuations, low order method .
odell3 - Solve non-stiff differential ecjuations, variabl e order method.
odelSs - Solve stiff differential ecjuations, variabl e order method.
ode23s - Solve stiff differential ecjuations, low order method.
odefile - ODE file syntax.
ODE Option handling.
odeset - Create/alter ODE OPTIONS structure,
odeget - Get ODE OPTIONS parame ters.
OPE output functions.
odeplot - Time series ODE output function.
odephas2 - 2-D phase plane ODE output function.
odephas3 - 3-D phase plane ODE output function,
odeprint - Command window printing ODE output function.
8/10/2019 Matlab Help Text
18/62
Sparse matrices.
Elementary sparse matrices.
speye - Sparse identity matrix.
sprand - Sparse uniformly distributed random matri x.
sprancJn - Sparse normally distributed random matri x.
sprandsym - Sparse random symmetric matrix.
spdiags - Sparse matrix formed from diagon als.
Full to sparse conversion.
sparse - Create sparse matrix.
full - Convert sparse matrix to full matrix ,
find - Find indices of nonzero elemen ts,
spconvert - Import from sparse matrix external format.
Working with sparse matrices.
nnz - Number of nonzero matrix elements .
nonzeros - Nonzero matrix elements.
nzmax - Amount of storage allocated for nonzero matrix elemen ts.
spones - Replace nonzero sparse matrix elements with ones.
spalloc - Allocat e space for sparse matrix.
issparse - True for sparse matrix.
spfun - Apply function to nonzero matrix elemen ts.
spy - Visualiz e sparsity patter n.
Reordering algorithms.
colmmd
symmmd
symrcm
colperm
randperm
cjmperm
Linear algebra,
eigs
svds
luinc
choline
normest
condest
sprank
Column minimum degree permutation.
- Symmetric minimum degree permutation.
- Symmetric reverse Cuthill-McKee permutation.
- Column permutation.
- Random permutation.
- Dulmage-Mendelsohn permutation.
A few eigenvalues.
A few singular values.
Incomplete LU factorization.
Incomplete Choles)cy factorization.
Estimate the matrix
2-norm.
1-norm condition number estimate.
Structural rank.
Linear Ecjuations (iterative methods ) .
peg - Preconditioned Conjugate Gradients Method.
bicg - BiConjugate Gradients Method.
bicgstab - BiConjugate Gradients Stabilized Method.
cgs - Conjugate Gradients Scjuared Method.
gmres - Generalized Minimirai Residual Method.
cjmr - Quasi-Minimal Residual Method.
Operations on graphs (trees).
treelayout - Lay out tree or forest.
treeplot - Plot picture of tree.
etree - Elimination tree.
etreeplot - Plot elimination tree.
gplot - Plot graph, as in "graph theory".
Miscellaneous.
symbfact - Symbolic factorization analys is.
spparms - Set parameter s for sparse matrix routin es.
spaugment - Form least scjuares augmented system.
8/10/2019 Matlab Help Text
19/62
Two dimensional graphs.
Elementary X-Y graphs.
plot
Ioglog
semilogx
semilogy
polar
plotyy
Axis control.
axis
zoom
grid
box
hold
axes
subplot
Linear plot.
Log-log scale plot.
Semi-log scale plot.
Semi-log scale plot.
Polar coordinate plot.
Graphs with y tick labels on the left and right.
- Control axis scaling and appearance.
- Zoom in and out on a 2-D plot.
- Grid lines.
- Axis box.
- Hold current graph.
- Create axes in arbitrary positions.
- Create axes in tiled positions.
Graph annotation.
legend - Graph legend.
title - Graph title.
xiabel -X-axislabel.
ylabel -Y-axislabel.
text - Text annotation.
gtext - Place text with mouse.
Hardcopy and printing.
print - Print graph or SIMULINK system; or save graph to M-file.
printopt - Printer defaults,
orient - Set paper orientation.
See also GRAPH3D, SPECGRAPH.
8/10/2019 Matlab Help Text
20/62
Three dimensional graphs.
Elementary 3-D plots.
plots - Plot lines and points in 3-D
mesh - 3-D mesh surface,
surf - 3-D colored surface.
fill3 - Filled 3-D polygons.
space.
Color control.
colormap
caxis
shading
hidden
brighten
Lighting,
surfl
lighting
material
specular
diffuse
surfnorm
Color look-up table.
Pseudocolor axis scaling.
Color shading mode.
Mesh hidden line removal mode.
Brighten or darken color map.
3-D shaded surface with lighting.
Lighting mode.
Material reflectance mode.
Specular reflectance.
Diffuse reflectance.
Surface normals.
Colormaps.
hsv
hot
gray
bone
copper
pink
white
flag
lines
colorcube
jet
prism
cool
autiimn
spring
winter
summer
Axis control,
axis
zoom
grid
box
hold
axes
subplot
Hue-saturation-value color map.
Black-red-yellow-white color map.
Linear gray-scale color map.
Gray-scale with tinge of blue color map.
Linear copper-tone color map.
Pastel shades of pink color map.
All white color map.
Alternating red, white, blue, and black color map.
Color map with the line colors.
Enhanced color-cube color map.
Variant of HSV.
Prism color map.
Shades of cyan and magenta color map.
Shades of red and yellow color map.
Shades of magenta and yellow color map.
Shades of blue and green color map.
Shades of green and yellow color map.
Control axis scaling and appearance.
Zoom in and out on a 2-D plot.
Grid lines.
Axis box.
Hold current graph.
Create axes in arbitrary positions.
Create axes in tiled positions.
Viewpoint control.
view - 3-D graph viewpoint specification.
viewmtx - View transformation matrix.
rotate3d - Interactively rotate view of 3-D plot.
Graph annotation.
title - Graph title.
xiabel -
X-axis
label.
ylabel -Y-axislabel.
zlabel -Z-axislabel.
colorbar - Display color bar (colorscale).
text - Text annotation.
gtext - Mouse placement of text.
Hardcopy and printing.
print - Print graph or SIMULINK system; or save graph to M-file.
printopt - Printer defaults,
orient - Set paper orientation.
See also GRAPH3D, SPECGRAPH.
8/10/2019 Matlab Help Text
21/62
Specialized graphs.
Specialized 2-D graphs.
area - Filled area plot.
bar - Bar graph.
barh - Horizontal bar graph.
bar3 - 3-D bar graph.
bar3h - Horizontal 3-D bar graph.
comet - Comet-like trajectory.
errorbar - Error bar plot .
ezplot - Easy to use function plotter.
feather - Feather plot.
fill - Filled 2-D polyg ons.
fplot - Plot function.
hist - Histogram.
pareto - Pareto chart.
pie - Pie chart.
pie3 - 3-D pie chart.
plotmat rix - Scatter plot matrix.
ribbon - Draw 2-D lines as ribbons in 3-D.
stem - Discr ete secjuence or "stem" plo t.
stairs - Stairstep plot .
Contour and 2-1/2 D graph s,
contour - Contour plot.
contourf - Filled contour plot .
contour3 - 3-D Contour plo t,
clabel - Contour plot elevation labels,
pcolor - Pseudocolor (checkerboard) plo t,
cjuiver - Quiver plo t.
voronoi - Voronoi diagram.
Specialized 3-D graphs.
comet3 - 3-D comet-like trajectories.
meshc - Combination mesh/contour plot .
meshz - 3-D mesh with curtain.
stem3 - 3-D stem plot.
ejuiver3 - 3-D cjuiver plot .
slice - Volumetric slice plot.
surfc - Combination surf/contour plot.
trisurf - Triangular surface plot .
trimesh - Triangular mesh plot.
waterfall - Waterfall plot.
Images display
image
imagesc
colormap
gray
contrast
brighten
colorbar
imread
imwrite
imfinfo
and file I/O.
Display image.
Scale data and display as image.
Color look-up table.
Linear gray-scale color map.
Gray scale color map to enhance image contrast.
Brighten or darken color map.
Display color bar (color
scale).
Read image from graphics file.
Write image to graphics file.
Information about graphics file.
Movies and animation.
capture - Screen capture of current figure.
moviei n - Initialize movie frame memory.
getframe - Get movie frame.
movie - Play recorded movie frames.
qtwrite - Translat e movie into QuickTime format (Macintosh only)
rotate - Rotate object about specified orgin and directio n.
frame2im - Convert movie frame to indexed image.
im2frame - Convert index image into movie format.
Color related functions.
spinmap - Spin color map.
rgbplot - Plot color map.
colstyle - Parse color and style from string.
Solid modeling.
cylinder - Generate cylinder,
sphere - Generate sphere,
patch - Create patch.
8/10/2019 Matlab Help Text
22/62
Handle Graphics.
Figure window creation and control,
ficfure - Create figure window,
gcf - Get handle to current figure,
elf - Clear current figure,
shg - Show graph window,
close - Close figure,
refresh - Refresh figure.
Axis creation and control.
subplot - Create axes in tiled positions.
axes - Create axes in arbitrary positions.
gca - Get handle to current
axes.
cla - Clear currentaxes.
axis - Control axis scaling and appearance.
box - Axis box.
caxis - Control pseudocolor axis scaling.
hold - Hold current graph.
ishold - Return hold state.
Handle Graphics objects.
figure - Create figure window.
axes - Createaxes.
line - Create line.
text - Create text.
patch - Create patch.
surface - Create surface.
image - Create image.
light - Create light.
uicontrol - Create user interface control.
uimenu - Create user interface menu.
Handle Graphics operations.
set - Set object properties.
get - Get object properties.
reset - Reset object properties.
delete - Delete object.
gco - Get handle to current object.
gcbo - Get handle to current callback object.
gcbf - Get handle to current callback figure.
drawnow - Flush pending graphics events.
findobj - Find objects with specified property values.
copyobj - Make copy of graphics object and its children.
Hardcopy and printing.
print - Print graph or SIMULINK system; or save graph to M-file.
printopt - Printer defaults,
orient - Set paper orientation.
Utilities,
closereq
newplot
ishandle
Figure close recjuest function.
M-file preamble for NextPlot property.
True for graphics handles.
See also GRAPH2D, GRAPH3D, SPECGRAPH.
8/10/2019 Matlab Help Text
23/62
Graphical user interface tools.
GUI functions.
uicontrol - Create user interface control.
uimenu - Create user interface menu.
ginput - Graphical input from mouse .
dragrect - Drag XOR rectangles with mouse .
rbbox - Rubberband box.
selectmoveresize - Interactively select, move, resize, or copy objects.
waitforb uttonpre ss - Wait for key/buttonpress over figure .
waitfor - Block execution and wait for event .
uiwait - Block execution and wait for resume.
uiresume - Resxame execution of blocked M-fil e.
GUI design tools.
guide - Design GUI.
align - Align uicontrols and
axes.
cbedit - Edit callback.
menuedit - Edit menu.
propedit - Edit property .
Dialog boxes.
dialog - Create dialog figure.
axlimdlg - Axes limits dialog box.
errordlg - Error dialog box.
helpdlg - Help dialog box.
inputdlg - Input dialog box.
listdlg - List selection dialog box.
menu - Generate menu of choices for user input.
msgbox - Message box.
cjuestdlg - Question dialog box.
warndlg - Warning dialog box.
uigetfil e - Standard open file dialog box.
uiputfil e - Standard save file dialog box.
uisetcolor - Color selection dialog box.
uisetfont - Font selection dialog box.
pagedlg - Page position dialog box.
printdlg - Print dialog box.
waitbar - Display wait bar.
Menu utilities.
makemenu - Create menu structure.
menubar - Computer dependent default setting for MenuBar property.
umtoggle - Toggle "checked" status of uimenu object.
winmenu - Create submenu for "Window" menu item.
Toolbar button group utilities.
btngroup - Create toolbar button group ,
btnstate - Query state of toolbar button group ,
btnpress - Button press manager for toolbar button group ,
btndown - Depress button in toolbar button group,
btnup - Raise button in toolbar button group.
User-defined figure/axes property utilities,
clruprop - Clear user-defined property,
getuprop - Get value of user-defined property ,
setuprop - Set user-defined property.
Miscellaneous utilities.
allchild - Get all object children.
hidegui - Hide/unhide GUI .
edtext - Interactive editing of axes text object s.
getstatus - Get status text string in figure.
setstatus - Set status text string in figure.
popupstr - Get popup menu selection string.
remapfig - Transform figure objects' positi ons.
setptr - Set figure pointer.
getptr - Get figure pointer .
overobj - Get handle of object the pointer is over.
8/10/2019 Matlab Help Text
24/62
Character strings.
General.
char
double
cellstr
blanks
deblank
eval
String tests,
ischar
iscellstr
isletter
isspace
String operat
strcat
strvcat
strcmp
strncmp
findstr
strjust
strmatch
strrep
strtok
upper
lower
- Create character array (string).
- Convert string to numeric character codes.
- Create cell array of strings from character array.
- String of blanks.
- Remove trailing blanks.
- Execute string with MATLAB expression.
- True for character array (string).
- True for cell array of strings.
- True for letters of the alphabet.
- True for white space characters.
ions.
- Concatenate strings.
- Vertically concatenate strings.
- Compare strings.
- Compare first N characters of strings.
- Find one string within another.
- Justify character array.
- Find possible matches for string.
- Replace string with another.
- Find token in string.
- Convert string to uppercase.
- Convert string to lowercase.
String to number conversion.
num2str
int2str
mat2str
str2num
sprintf
sscanf
Base number
hex2num
hex2dec
dec2hex
bin2dec
dec2bin
base2dec
dec2base
- Convert number to string.
- Convert integer to string.
- Convert matrix to eval'able string.
- Convert string to number.
- Write formatted data to string.
- Read string under format control.
conversion.
- Convert IEEE hexadecimal to double precision numl>er.
- Convert hexadecimal string to decimal integer.
- Convert decimal integer to hexadecimal string.
- Convert binary string to decimal integer.
- Convert decimal integer to binary string.
- Convert base B string to decimal integer.
- Convert decircal integer to base B string.
See also STRINGS.
8/10/2019 Matlab Help Text
25/62
F i l e i n p u t / o u t p u t .
File openingandclosing,
fopen -Open file,
fclose -Close file.
Binary fileI/O.
fread -Read binary data from file,
fwrite -Wri te binary cJatatofile.
Formatted fileI/O.
fscanf -Read formatted ciata from file.
fprintf -Write formatted datatofile.
fgetl -Read line from file, discard newline ch aracter .
fgets
-
Read line from file, keep newline char acter.
input -Promptforuser input.
String conversion.
sprintf -Write formatted datatostring,
sscanf -Read string unde r format contr ol.
File positioning.
ferror -Incjuire file error status,
feof -Testforend-of-file.
fseek - Setfile position indicator,
ftell - Getfile position indi cator,
frewind -Rewind file.
File ncime handling
matlabroot
-
Root directory
of
MATLAB installation,
filesep -Directory separatorforthis p latform,
pathsep -Path separatorforthis plat form,
mexext - MEXfilename extensionforthis plat form,
fullfile -Build full filename from par ts,
partialpath-Partial pathn ames,
tempdir - Gettemporary directory,
tempname
- Get
temporary file.
File import/export functions.
load -Load workspace from MAT-file.
save -Save workspacetoMAT-file.
dliruread -Read ASCII delimit ed file,
dlmwrite
-
Write ASCI I delimited file,
wklread -Read spreadsheet (WKl)file,
wklwrite -Write spreadsheet (WKl)file.
Image file import/export.
imread -Read image from graphics file.
imwrite -Write imagetographics file.
imfinfo -Return information about graphics file.
Audio file import/export.
auwrite -Write NeXT/SUN ( .au )sound file,
auread -Read NeXT/SUN ( .au )sound file,
wavwrite
-
Write Microsoft WAVE
( .wav )
sound file.
wavread -Read Microsoft WAVE ( .wav )sound file.
Command windowI/O
clc
home
disp
input
pause
Clear command window.
Send cursor home.
Display array.
Promptforuser input.
Wait
for
user response.
8/10/2019 Matlab Help Text
26/62
Time and dates.
Current date and time.
now - Current date and time as cJate numb er.
c3ate - Current date as date string.
clock - Current date and time as ciate vector .
Basic functions.
datenum - Serial date number.
cJatestr - String representa tion of date.
datevec - Date componen ts.
Date functions.
calendar - Calendar.
weekcJay - Day of week.
eomday - End of month.
datetick - Date formatted tick labels.
Timing functions.
cputime - CPU time in seconds,
tic, toe - Stopwatch timer,
etime - Elapsed time.
pause - Wait in seconds.
8/10/2019 Matlab Help Text
27/62
Data types and structures.
Data types (classes)
double
sparse
char
cell
struct
uinta
inline
Convert to double precision.
Create sparse matrix.
Create character array (string).
Create cell array.
Create or convert to structure array.
Convert to unsigned 8-bit integer.
Construct INLINE object.
Multi-dimensional array functions,
cat - Concatenate arrays.
ndims - Number of dimensio ns.
ndgrid - Generate arrays for N-D functions and interpola tion,
permute - Permute array dimensions,
ipermute - Inverse permute array dimens ions,
shiftdim - Shift dimens ions,
scjueeze - Remove singleton dime nsio ns.
Cell array functions.
cell - Create cell array.
celldisp - Display cell array content s.
cellplot - Display graphical depiction of cell array.
num2cell - Convert numeric array into cell array.
deal - Deal inputs to outputs .
cell2struct - Convert cell array into structure array.
struct2cell - Convert st ructure array into cell array.
iscell - True for cell array.
Structure functions.
struct - Create or convert to structure array.
fieldnames - Get structure field names .
getfield - Get structure field conten ts.
setfield - Set structure field conten ts.
rmfield - Remove structure field.
isfield - True if field is in structure array.
isstruct - True for structures.
Object oriented programming functions.
class
struct
methods
isa
isobject
inferiorto
superiorto
Overloadable
minus
plus
times
mtimes
mldivide
nurdivide
rdivide
Idivide
power
mpower
uminus
uplus
horzcat
vertcat
le
It
gt
ge
eq
ne
not
and
or
subsasgn
subsref
colon
transpose
ctranspose
subsindex
- Create object or return object class.
- Convert object to structure array.
- Display class method names.
- True if object is a given class.
- True for objects.
- Inferior class relationship.
- Superior class relationship.
operators.
- Overloadable
- Overloadable
- Overloadable
- Overloadable
- Overloadable
- OverloacJable
- OverloacJable
- Overloadable
- Overloadable
- Overloadable
- Overloadable
- Overloadable
- OverloacJable
- Overloadable
- OverloacJable
- Overloadable
- Overloadable
- OverloacJable
- Overloadable
- OverloacJable
- Overloadable
- Overloadable
- Overloadable
- Overloadable
- Overloadable
- Overloadable
- Overloadable
- Overloadable
- Overloadable
method for a-b.
method for a+b.
method for a.*b.
method for a*b.
method for a\b.
method for a/b.
method for a./b.
method for a.\b.
method for a.'b.
method for a^b.
method for -a.
method for +a.
method for [a b ] .
method for [a;b].
method for a=b.
method for a==b.
method for a~=b.
method for -a.
method for a&b.
method for a|b.
method for a(i)=b, a{i}=b, and a.field=b.
method for a (i) , a{i ), and
a.field.
method for a:b.
method for a.'
method for a'
method for x( a) .
8/10/2019 Matlab Help Text
28/62
signal Processing Toolbox.
Version 4.0 Student Edition 31-Dec-1996
What's new.
ReacJme
New features, bug fixes, and changes in this version.
Waveform generation.
chirp
diric
gauspuls
pulstran
rectpuls
sawtooth
sine
scjuare
tripuls
Filter analysis
abs
angle
easfilt
conv
fftfilt
filter
filtfilt
filtic
freqs
freqspace
freqz
grpdelay
impz
latcfilt
unwrap
upfirdn
zplane
Swept-frecjuency cosine generator.
Dirichlet (periodic sine) function.
Gaussian pulse generator.
Pulse train generator.
Sampled aperiodic rectangle generator.
Sawtooth function.
Sine or sin(pi*x)/(pi*x) function
Scjuare wave function.
Sampled aperiodic triangle generator.
1 and implementati on.
Magnitude.
Phase angle.
Cascade filter implementation.
Convolution.
Overlap-add filter implementation.
Filter implementation.
Zero-phase version of filter.
Determine filter initial conditions.
Laplace transform frecjuency response.
Frecjuency spacing for frecjuency response.
Z-transform
frecjuency response.
Group delay.
Impulse response
(discrete).
Lattice filter implementation.
Unwrap phase.
Up sample, FIR filter, down sample.
Discrete pole-zero plot.
Linear system transformations,
eonvmtx - Convolution matrix.
Iatc2tf - Lattice or lattice ladder to transfer function conversi on.
poly2rc - Polynomial to reflection coefficients transform ation.
rc2poly - Reflection coefficients to polynomial transfor mation,
residuez -
Z-transform
partial fraction expansion.
sos2ss - Second-order sections to state-space conversi on.
sos2tf - Second-order sections to transfer function conversi on.
sos2zp - Second-order sections to zero-pole conversi on.
ss2sos - State-space to second-order sections conversi on.
ss2tf - State-space to transfer function conversion .
ss2zp - State-space to zero-pole conversion.
tf21atc - Transfer function to lattice or lattice ladder conversi on.
tf2ss - Transfer function to state-space conversion .
tf2zp - Transfer function to zero-pole conversion .
zp2sos - Zero-pole to second-order sections conversi on.
zp2ss - Zero-pole to state-space conversio n.
zp2tf - Zero-pole to transfer function conversion .
IIR digital filter design.
butter - Butterworth filter design.
chebyl - Chebyshev type I filter design.
cheby2 - Chebyshev type II filter design .
ellip - Elliptic filter design.
maxflat - Generalize d Butterworth lov^ass filter design .
yulewalk - Yule-Walker filter design.
IIR filter order selection.
buttord - Butterworth filter order selection,
cheblord - Chebyshev type I filter order selection.
cheb2ord - Chebyshev type II filter order selecti on,
ellipord - Elliptic filter order selection.
FIR filter design.
cremez - Complex and nonlinear phase ecjuiripple FIR filter desig n.
firl - Window based FIR filter design - low, high, band, stop, mult i.
fir2 - Window based FIR filter design - arbitrary respons e.
fircls - Constrained Least Squares filter design - arbitrary respon se.
firclsl - Constrained Least Scjuares FIR filter design - low and highp ass.
firls - FIR filter design - arbitrary response with transition band s.
firrcos - Raised cosine FIR filter design.
intfilt - Interpolation FIR filter design.
kaiserord - Window based filter order selection using Kaiser window .
remez - Parks-McClellan optimal FIR filter design .
8/10/2019 Matlab Help Text
29/62
remezord
Parks-McClellan filter order selection.
Transforms.
czt
det
dftmtx
fft
fftshift
hilbert
idct
ifft
Statistical
cohere
corrcoef
cov
csd
pmem
pmtm
pmusic
psd
spectrum
tfe
xcorr
xcov
Windows.
b a r t l e t t
b lacJanan
b o x c a r
ch eb win
haituming
h arm in g
k a i s e r
t r i a n g
- Chirp-z transform.
- Discrete cosine transform.
- Discrete Fourier transform matrix.
- Fast Fourier transform.
- Swap vector halves.
- Hilbert transform.
- Inverse discrete cosine transform.
- Inverse fast Fourier transform.
signal processing and spectral analysis.
- Coherence function estimate.
- Correlation coefficients.
- Covariance matrix.
- Cross Spectral Density.
- Power Spectrum estimate via MEM (Maximum Entropy
Method).
- Power Spectrum estimate via the Thomson multitaper method.
- Power Spectrum estimate via MUSIC eigenvector method.
- Power Spectral Density.
- psd, csd, cohere and tfe combined.
- Transfer function estimate.
- Cross-correlation function.
- Covariance function.
Bartlett window.
Blackman window.
Rectangular window.
Chebyshev window.
Hamming window.
Harming window.
Kaiser window.
Triangular window.
Parcimetric modeling.
invfreqs - Analog filter fit to frecjuency response.
invfreqz - Discr ete filter fit to frecjuency response.
levinson - Levinson-Du rbin recursion.
Ipc - Linear Predictive Coefficients using autocorrel ation method.
prony - Prony's discrete filter fit to time respon se.
stmcb - Steiglitz-McBri de iteration for ARMA modeling .
ident - See the System Identification Toolbox.
Specialized operations.
cceps - Complex cepstrum.
decimate - Resample data at a lower sample rate.
deconv - Deconvoluti on.
demod - Demodulati on for communications simulation.
dpss - Discr ete prol ate sphero idal secjuences (Slepian secjuences) .
dpssclear - Remove discrete prolate spheroidal secjuences from datab ase.
dpssdir - Discrete prolate spheroidal secjuence database director y.
dpssload - Load discrete prolat e spheroidal secjuences from datab ase.
dpsssave - Save discrete prolate spheroidal secjuences in datab ase.
interp - Resample data at a higher sample rate.
interpl - General 1-D interpolation. (MATLAB Toolbox )
medfiltl -1-Dimensional median filtering.
modula te - Modulatio n for communications simulati on.
rceps - Real cepstrum and minimum phase reconstruct ion.
resample - Resample secjuence with new sampling rate.
specgram - Spectrogram, for speech signals .
spline - Cubic spline interpolation.
vco - Voltage controlled oscillator.
Analog lowpass filter prototypes.
besselap - Bessel filter protot ype.
buttap - Butterworth filter prototy pe.
cheblap - Chebyshev type I filter prototype (passband
ripple).
cheb2ap - Chebyshev ty[pe II filter prototyp e (stopband
ripple).
ellipap - Elliptic filter prototyp e.
Frecjuency translation.
Ip2bp - Lowpass to bandpass analog filter transformati on.
Ip2bs - Lov^ass to bandstop analog filter transformati on.
Ip2hp - LovTpass to highpass analog filter transformati on.
Ip21p - Lowpass to lov/pass analog filter transformat ion.
Filter discretization.
bilinear - Bilinear transformation with optional prewar ping.
impinvar - Impulse invariance analog to digital convers ion.
8/10/2019 Matlab Help Text
30/62
other.
besself - Bessel analog filter design.
conv2 - 2-D convolution.
cplxpair - Order vector into complex conjugate pai rs.
detrend - Linear trend removal.
fft2 - 2-D fast Fourier transform.
fftshift - Swap cjuadrants of array .
ifft2 - Inverse 2-D fast Fourier transform.
polyst ab - Polynomial stabilizati on.
stem - Plot discrete data secjuence.
strips - Strip plot.
xcorr2 - 2-D cross-correl ation.
Signal GUI (Graphical User Interface).
sptool - Signal Processing Tool interface.
Demonstrations.
cztdemo - Chirp-z transform and FFT demonst ration,
filtdemo - Filter design demonstra tion,
moddemo - Modulation/demodulation demonstration,
sosdemo - Second-order sections demonstra tion.
8/10/2019 Matlab Help Text
31/62
S y m b o l i c M a t h T o o l b o x .
Version 2.0 Student Edition 18-Feb-1997
Calculus.
diff
int
limit
taylor
jacobian
symsum
Linear Algebra,
diag
triu
tril
inv
det
rank
rref
null
colspace
eig
svd
jordan
poly
expm
Simplification,
simplify
expand
factor
collect
simple
numden
horner
subexpr
subs
Differentiate.
Integrate.
Limit.
Taylor series.
Jacobian matrix.
Summation of series.
Create or extract diagonals.
Upper triangle.
Lower triangle.
Matrix inverse.
Determinant.
Rank.
Reduced row echelon form.
Basis for null space.
Basis for column space.
Eigenvalues and eigenvectors.
Singular values and singular vectors.
Jordan canonical (normal) form.
Characteristic polynomial.
Matrix exponential.
Simplify.
Expand.
Factor.
Collect.
Search for shortest form.
Numerator and denominator.
Nested polynomial representation.
Rewrite in terms of subexpressions.
Symbolic substitution.
Solution of Ecjuations.
solve - Symbolic solution of algebraic ecjuations.
dsolve - Symbolic solution of differential ecjuations.
finverse - Functional inverse,
compose - Functional compositio n.
Variable Precision Arithmetic.
vpa - Variable precision arithmetic,
digits - Set variable precision accuracy.
Integral Transforms.
fourier - Fourier transform,
laplace - Laplace transform,
ztrans - Z transform,
ifourier - Inverse Fourier transform,
ilaplace - Inverse Laplace transform,
iztrans - Inverse Z transform.
Conversions.
double
poly2sym
sym2poly
char
- Convert symbolic matrix to double .
- Coefficient vector to symbolic polynomial.
- Symbolic polynomial to coefficient vector.
- Convert sym object to string.
Basic Operations,
sym
syms
findsym
pretty
latex
ccode
fortran
Create symbolic object.
Short-cut for constructing symbolic objects.
Determine symbolic variables.
Pretty print a syitJaolic expression.
LaTeX represention of a symbolic expression.
C code represention of a symbolic expression.
Fortran represention of a symbolic expression.
Special Functions.
sinint - Sine integral,
cosint - Cosine integral,
zeta - Riemarm zeta function,
lambertw - Leimbert W function.
String handling utilities.
isvarname - Check for a valid variable neime.
vectorize - Vectorize a symbolic expression.
8/10/2019 Matlab Help Text
32/62
8/10/2019 Matlab Help Text
33/62
9/6/00 5:23 IM fixd ivty ze ro.m Page 1
function f=fix div tyz ero (x)
FIXDIVBY2EEO r ^ l a c e s ze ro v al ue s by eps t o av oid di v t y ze ro eirro rs
% f=f ixdiv tyzero
(x)
re tu rn s eps i f x=0; ot i ierwise i t s imply retm m s x
f=x+(x=0)*^)s ;
8/10/2019 Matlab Help Text
34/62
9/6/00 5:18 IM blank.m V ag el L
fun ct io n bl an k (tnum)
%%%BLANK d i s p l a y s b l a n k l i n e s
BLANK d is p la y s one b la n k l i n e
BLMQK{bium) d i s p l a y s tanum nunriber of b la n k l i n e s
i f na rg in = 0 , tnum=l ; end ;
for n=l:bnum;
d i s p C ) ;
a id;
8/10/2019 Matlab Help Text
35/62
9/6/00 5:17 EM rad.m E^ge \ /
function r=rad(degrees)
% RAD converts degrees to radians
% r=RAD(degrees) returns the number in degrees
%
r=p i *degrees /180 ;
8/10/2019 Matlab Help Text
36/62
9/6 /00 5:17 EM rad2c3eg.in Page l /
function d=rad2deg(radians)
% RAD2DEG converts radians to degrees
% d=RAD2DEG(radians) retums the number in degrees
%
d = 1 8 0 * r a d i a n s / ( 2 * p i ) ;
8/10/2019 Matlab Help Text
37/62
9/6/00
5:18 dhangenenu.iti E^ge l A
function new = changemenu(names,old)
% CHAf lGEMENU generates a menu to change various parameters
% new = ROUND TRIPABCD(name_cell_array,old) takes a Ix n array of n variables and a Ix n cell array
% containing infonnation for the labels of the menu , asks for user input through the men u, and
outputs
% the 1xn array of new variables.
% typical input : names = {'Distance to Mirror 1 ', 'Focal Length of Mirror 1 ', 'Distance to Mirror 2'}
% old = {500, 300,400,0,0,0}
% (the last three numbers represent the last changed
field,
the change, and the amount of the change)
% exit code is given by 999 in the (last changed field) value
% written by Phil Tsai 11-03-99
% last revision 11-04-99
lastchoicel = old(1,4);
lastchoice2 = old(1,5);
lastchange=old(1,6);
new = old;
changeby = 0;
changeto = 0 ;
choice 1 = 0;
choice2 = lastchoice2;
';hoicelist{1} = 'Pick a parameter to change';
jhoicelist{2} = 'Repeat Last';
[r,c] = size(old);
num_elements = c-3;
for j=1:num_elements
choicel ist{j+2} = char(names(1,j));
end
choicelist{num_elements-i-3} = 'Exit Program';
choicel = strmenu(choicelist);
% if choicel = 1 then repeat
% if cho icel = (num_eleme nts+2) then return la stcho icel =999 exit code
if choice l ==num_elements+2, new(1,num_elements+1)=999; return; end;
if cho icel ~=1
choice2 = menu('Pick one:','Change to..','lncrease by..','Decrease by..');
end
if choice2 ==1
changeto = input('Change to : ');
)lse
if choicel~=1 & choice2==2, changeby = input('lncrease by: '); end;
if choicel~=1 & choice2==3, changeby = input('Decrease by: '); end;
end
8/10/2019 Matlab Help Text
38/62
9/6/00 5: 18 EM
if isempty(changeto); changeto=0; end;
f isempty(changeby);changeby=0;end;
if ch oice l ==1
if lastchoicel == 0 ; new = old; return; end;
if lastchoice2 == 0; new = old; return; end;
choicel = lastchoicel;
choice2 = lastchoice2;
changeby = lastchange;
end
if choice2 == 1
if changeto == 0, changeto = in f; end;
new(1,choicel-1) = changeto;
end
if choice2 == 2,
new(1,choicel-1 )
= old(1,ch oice l-1)
8/10/2019 Matlab Help Text
39/62
9/6/00
5:17 IM req ues t .m Page 1
function value = request(question,default_value,minv,maxv)
% R EQUE ST(question,default_value,min,max) : input prompt with default value
% value = request(question,default_value) prompts the user with ques tion, and shows
% the default value. If the user hits return without entering an input,
% the function will return default_value as the output value. O therwise, the user
% input is returned.
% If the minv and maxv are provided, then the function checks to see if the
% input is within the specified range; if not, either maxv or minv is returned
reqstring = [question,' [default = ',num2str(default_value),'] -> '] ;
temp_value = input(reqstring);
if isempty(temp_value)
value = default_value;
re tu rn ;
end
if nargin < 3
value = temp_value;
re tu rn ;
end
if nargin == 3; maxv = inf; end;
if temp_value > maxv
value = maxv;
d is p( [' WAR NING, the requested number must be less than ',num2str(maxv)]);
d is p( [' the value of this input has been set to ',num2str(maxv)]);
re tu rn ;
end
if temp_value < minv
value = minv;
di sp ([ ' WAR NING, the requested number must be greater than ',num2str(minv)]);
di sp ([ ' the value of this input has been set to ',num2str(minv)]);
re tu rn ;
end
value = temp_value;
8/10/2019 Matlab Help Text
40/62
9/6/00 5: 17 EM
strmenu.m
E^ge 1/
function k = strmenu(myinput);
%STRMENU Generate a menu of choices for user input (in fomri of cell array ).
% K = MEN U(cell_array) displays a menu with cell_array(1) as header
% and cell_array(2), etc as choices
%
cell array should be a Ixn cell array
created as follows:
cell_array{1} = 'Choose acolor'
cell_array{2} = '1) Red'
cell_array{3} = '1) Blue'
cell_array{4} = '1) Green'
will produce the following menu on the screen:
Choose a color
1)Red
2) Blue
3) Green
Select a menu number:
The number entered by the user in response to the prompt is
returned. On machines that support it, the local menu system
is used. The maximum number of menu items is 32.
See also MENU.
% J.N. Little 4-21-87, revised 4-13-92 by LS.
% Copyright (c) 1984-96 by The MathW orks, Inc.
% $Revision: 5.7 $ $Date: 1996/05/09 18:48:57 $
% Modified by Phil Tsai 99/11/03 to accept cell array
[myrows,myco ls ]=s ize(myinput) ;
my input{33}= 'end ' ;
sO=char (my inpu t (1 ) ) ;
s 1 = c h a r (my i n p u t ( 2 ) ) ;
if mycols>2
if mycols>3
if mycols>4
if mycols>5
if mycols>6
if mycols>7
if mycols>8
if mycols>9
if mycols>10
if mycols>11
'f mycols>12
(f mycols>13
if mycols>14
if mycols>15
if mycols>16
s2=char(myinput(3)); end;
s3=char(myinput(4)); end;
s4=char(myinput(5)); end;
s5=char(myinput(6)); end;
s6=char(myinput(7)); end;
s7=char(myinput(8)); end;
s8=char(myinput(9)); end;
s9=char(myinput(10)); end;
s10=char(myinput(11)
s11=char(myinput(12)
si 2=char(myinput(13)
s13=char(myinput(14)
si 4=char(myinput(15)
si 5=char(myinput(16)
si 6=char(myinput(17)
end;
end;
end;
end;
end;
end;
end;
8/10/2019 Matlab Help Text
41/62
9/6/00 5:1']
f mycols>17
f mycols>18
f mycols>19
f mycols>20
f mycols>21
f mycols>22
f mycois>23
f mycols>24
f mycols>25;
f mycols>26;
f mycols>27;
f mycols>28;
f mycols>29;
f mycols>30;
f mycols>31;
f mycols>32;
' EM
s17=char(myinput(18))
s18=char(myinput(19))
si 9=char(myinput(20))
s20=char(myinput(21))
s21=char(myinput(22))
s22=char(myinput(23))
s23=char(myinput(24))
s24=char(myinput(25))
s25=char(myinput(26))
s26=char(myinput(27))
s27=char(myinput(28))
s28=char(myinput(29))
s29=char(myinput(30))
s30=char(myinput(31))
s31
= char(myinput(32))
s32=char(myinput(33))
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end
strmenu.m
Page 2
c = computer;
display = 1;
PC = strcmp(c(1:2),'PC');
i f -strcmp(c(1:2), 'PC') & -strcmp(c(1:2), 'MA')
% might be unix or VMS
if isunix
display = length(getenv('DISPLAY')) > 0;
else
display = length(getenv('DECW$DISPLAY')) > 0;
end
end
if -display
while 1,
dispC ')
clisp([' ',s0,' '])
dispC ')
for n=1:(mycols-1)
disp([' ',int2str(n),') ',eval(['s',int2str(n)])])
end
dispC ')
k = input('Select a menu number: ');
if isempty(k), k = - 1 ; end;
if (k < 1) I (k > mycols - 1 ) 1
(~isreal(k))
I (isnan(k)) I isinf(k),
dispC ')
dispCSelection out of range. Try again.')
else
return
end
end
end
kids = get(0,'Children');
if ~isempty(kids)
otherfig = gcf;
M=get(otherfig,'Colormap');
else
8/10/2019 Matlab Help Text
42/62
9/6/00
5:17 EM st:ntenu.m Page 3
M=get(0,'DefaultFigureColormap');
end
xedge = 30;
yedge = 35;
ybord = 30;
width = 30;
avwidth = 7; % actually 6.8886
- i - / - 0.4887
height = 30;
imax = 1;
maxlen = length(sO);
for i =
1:mycols-1
mx = Iength(eval(['s',int2str(i)]));
if mx > maxlen
maxlen = mx;
imax = i;
end
end
twidth = 1.2*maxlen*avwidth;
% now figure out total dimensions needed so things can get placed in pixels
mwwidth = twidth + width + 2*xedge;
mwheight = (mycols-i-1)*yedge;
ss = get(0,'ScreenSize');
swidth = ss(3); sheight = ss(4);
%left = (swidth-mwwidth)/2;
eft = 20;
bottom = sheight-mwheight-ybord;
rect = [left bottom mwwidth mwheight];
fig = figure ('units','pixe ls','Position ',rect,'nu m ber','off,'n am e',' ', ...
'resize','off','Colormap',M);
set(gca,'units','normalized','Position',[0 0 1 1]); axis off;
% Place title
t = text(mww idth/2,mwhe ight-yedge/2,s0,'Horizontal ', 'center',...
'Vertical','top','units','pixels');
for i i=(mycols-1):-1:1
i = mycols - ii;
hi = uicontrol('units','pixels','position', ...
[xedge (i-.5)*yedge width+twidth height]);
set(h1,'cal lback',[ 'set(gcf,"userdata",', int2str(i i ), ') ' ]);
set(h 1,'string',[' ', eva l(['s',int2str(i i)])])
set(h1,'HorizontalAlignment','left');
% left justify string inside button
end
wai t for(gcf, 'userdata ')
k = get(gcf,'userdata');
delete(fig)
if ~isempty(kids)
ch = get(0,'children');
if ~isempty(ch),
if ~isempty(find(ch == otherfig)), % Make sure figure is there
if strcmp(get(otherfig,'Visible'),'on')
set(0,'CurrentFigure',otherfig);
end
8/10/2019 Matlab Help Text
43/62
9/6/00 5:17 EM st:nnenu.m E^ge 4
end
end
end
8/10/2019 Matlab Help Text
44/62
9/6/00 5:1 9 EM WBMsfonn.m Page 1
f u n c t i o n w = w a v e f o r m ( f r e q u e n c i e s , a m p l i t u d e s , c e n t e r s , s t a r t p , e n d p , p s t e p , i n d e x )
% WAVEFORM p r o d u c e s t h e s h a p e o f a d i s p e r s e d w a v e p a c k e t
% w =
waveform(frequencies,amplitudes,centers,start_pos,end_pos,pos_step_size)
% returns a 2 x [ (endj)OS-start_pos)/po_step_size]
% array of positions and interfered amplitudes based on an input of
% frequencies, their amplitudes, and their centers (phase information)
% the desired start,end and
% (each input is a 1 x n array)
%
% written by Phil Tsai on 11-06-99
% last revision : 11-06-99
temp(1,1:(fix((endp - startp)/pstep))+1) = startp:pstep:endp;
temp(2,1:(fix((endp - startp)/pstep))+1)=0;
k = frequencies(1,:) * index / 3e8;
[ row,num_freqs] = size(frequencies);
for j =1:num_freqs
temp(2,:) = temp(2,:) +cos(k(1,j),*(temp(1,:)-centers(1,j)));
end;
"V = temp;
8/10/2019 Matlab Help Text
45/62
9/6/00 5: 20 EM
testnatirix.m
Page l/
%testmatrix.m
% this program simply generates some usable test matrices
cell array =
{ ' m '
' P ' -
,
' i '
c '
3 , 0
5 , 0 0; %q(1) should now yield a real spot size,
b l a n k ( 3 ) ;
% but just in case....
disp ('WAIT SOMETHING IS WRONG q(1) yields imaginary spot size ');
b l a n k (3 ) ;
end
qo = q_parameter;
8/10/2019 Matlab Help Text
47/62
9/6/00
5:20 EM spo tsize .m Page \ /
function [spot_size,radius_of.curvature] = spotsize(q_parameter,wavelength,ambient_index)
% SPOTSIZE calculates the spotsize(half-diameter) and radius of curvature of a gaussian beam
% [spot,radius]=SPOTSIZE(q_param eter,wavelength,index) gives the spot size and radius of
% curvature for a gaussian beam with the input of the q-parameter, the wavelength of light,
% and the index of the propagation medium
% written by Phil Tsai 11-04-99
% last revision 11-10-99
temp = imag(1 ./q_parameter);
temp=f ixd ivbyzero( temp);
temp=( -1 *wave leng th ) . / ( temp*p i *amb ien t_ index ) ;
spot_size=sqrt( temp);
if nargout
8/10/2019 Matlab Help Text
48/62
9/6/0 0 5:2 1 EM qparam.m E^ge l /
C
o.
function q = qparam(spotsize, radius, wavelength, index)
% OPARAM calculates the q-parameter of a gaussian beam of given spotsize(half-diameter) and radius
'/o q = QPARA M(spotsize,radius_curvature,wavlength,index) returns the q_parameter for a gua ssian
beam at the point where it has the inputted spotsize & radius_curvature for the given wavelength
and ambient index of propagation
written by Phil Tsai 11-10-99
last revision 11-10-99
termi = 1/radius;
term2 = wavelength / (pi*index*spotsize'^2);
q = 1/ (termi - i * term2);
8/10/2019 Matlab Help Text
49/62
9/6/00 5:21 IM cp tics .m Page 1
function M=op tics(type,param1 ,param2,param3)
% OPTICS is an alias for function OPTIC
% written by P hil Tsai 11-01-99
% last revision 11-04-99
if nargin == 4, M=optic(type,param1,param2,param3); end
if nargin == 3, M=optic(type,param1 ,param2); end
if nargin == 2, M=optic(type,param1); end
if nargin
8/10/2019 Matlab Help Text
50/62
9/6/00
5:23 IM beamdivergence.m Page l A
% beamdivergence.m outputs the beam divergences for a given spot size and a range of radii of curvature
%
/o written by Phil Tsai 11-10-99
% last revision 11-10-99
%
spot = request('Enter half-diameter spotsize(in mm) at output of laser',0.35);
start_radius = request('Enter starting radius of curvature (in mm)',spot*1000);
stop_radius = request('Enter stopping radius of curvature (in mm)',spot*2000);
step_size = request('Enter step size of radius (in mm)',spot*10);
distance = request('Enter distance(in m m) over w hich to evaluate beam ', 10);
wavelength = request('Enter wavelength of laser (IN NANOMETERS)',800);
wavelength =
wavelength/1
e6;
index = request('Enter index of propagation medium',1);
clear divergence;
count = 1;
for r = start_radius:step_size:stop_radius;
termi = 1/r;
term2 = - i *wavelength/(pi* index*spot^2);
qo = 1/(term1+term2);
q1 = qo + distance;
temp = -1*imag(1/q1);
spot2 = 1 /(sqrt(temp *pi*index/wav elength));
y = spot2-spot;
angle = atan(y/distance);
divergence(1,count) = r;
divergence(2,count) = angle*1000;
count=count+1;
end
plot(divergence(1,:) ,d ivergence(2,:))
xlabel('radius of curvature (in mm) at laser outp ut');
ylabel('half-angle beam divergence at laser output in milliradians');
gr id ;
8/10/2019 Matlab Help Text
51/62
9/6/00 5:21 IM roundtripabcd.m
function [rt.indiv] = roundtripabcd(cell_array)
% ROUNDTRIPABCD generated the ABCD ray matrix for a round trip in a laser cavity
/o rt = ROUN DTRIPABC D(cell_array) takes a nx4 cell_array containing information for the
% sequential ABCD matrices for the optics and the propagation through the cavity
% [rt,indiv] =RO UND TRIPA BCD (cell array) returns both the roundtrip ABCD matrix
% and the individual ABCD matrices in a 3-dim'l array
Page l /
o,
% celLar ray = {'m ' , 3 , 0 , 0 < - m irro r of radius of curvatu re = -i-3
p
, 5 , 0 , 0
8/10/2019 Matlab Help Text
52/62
9/6/00 5:21 IM
roundtripabcd m
end;
R0UNDTRIP=R0UNDTRIP*ABCD(:.:,j); ^
rt
= ROUNDTRIP;
ifnargout==2,indiv
=
ABCD;
end
8/10/2019 Matlab Help Text
53/62
9/6/00 5:22 EM cptic .m Page 1
function M= optic(type,param 1 ,param2,param3)
% OPTIC returns the ABCD ray matrix for an optical element
Vo OPTIC displays instructions for the function
% OPTIC(lens,focal_length) returns matrix for a thin lens of focal length = foc al je ng th
% OPT IC(mirror,radius) returns matrix for a mirror of radius of curvature = radius
% (positive radius = center of curvature on incident side)
% OPTIC(go,length) returns matrix for propagation of distance = length
% OPTIC(prop,length) returns matrix for propagation of distance = length
% OPTIC(travel,length) returns matrix for propagation of distance = length
% OP TIC(interface ,incident_index,tran sm itted_index) returns matrix for planar interface
% OP TIC(cinterface ,incident_index,tran smitted_ index,radius) returns matrix for a sph erical interface
% OP TIC(sinterface ,incident_index,trans mitted_inde x,radius) returns ma trix for a sph erical interface
% (positive radius = center of curvature on incident side)
%
%See
Also: GO, PROP, TRAVEL, MIRROR, LENS, INTERFACE
/o
% written by Phil Tsai 11-02-99
if nargin == 0,
b l a n k (2 ) ;
dispCOPTIC function returns the ABCD ray matrix for an optical element')
disp('OPTIC displays instructions for the function')
disp('OPTIC("lens",focal_length) returns matrix for a lens of stated focal length')
disp('OPTIC("mirror",radius) returns matrix for a mirror of stated radius of curvature')
dispC (positive radius = center of curvature on incident side)')
disp('OPTIC("go",distance) returns matrix for propagation of stated distance')
disp(' OP TIC("prop",distance) returns matrix for propagation stated distance')
disp{' OP TIC("travel",distance ) returns matrix for propagation stated distance')
disp('OPTIC("interface",n1,n2) returns matrix for planar interface indices n1 to n2')
disp('OPTIC ("cinterface",incident_index,transm itted_index,radius) returns matrix for a spherical
interface')
dispC OPT IC("sinterface",incident_index,transm itted_index,radius) returns matrix for a
spherical interface')
dispC (positive radius = center of curvature on incident side)')
b l a n k (2 ) ;
else
switch type
case {'lens'.'len',' '}
M=[1 , 0 ; -1/param1 , 1];
case { 'mirror ' , 'miror ' , 'm'}
M=[1 , 0 ; -2/param1 , 1];
case {'go', 'prop', ' travel ', 'p', 'g', ' t '}
M=[1 , parami ; 0 , 1 ] ;
case {' interface', ' inter', ' '}
M=[1 , 0 ; 0 , param i/param2];
case {'cinterface', 'sinterface', 'cinter', 'sinter'}
M=[1 , 0 ; (param2-param1)/(param2*param3) , para m i/para m 2];
otherwise
b lank (2 )
dispCError in input: type "optic" for instruction');
8/10/2019 Matlab Help Text
54/62
9/6/00 5:22 EM
cptic m
blank(2)
I^g
end M=2eros(2) ;
end
8/10/2019 Matlab Help Text
55/62
9/6/00 5:22 EM gaussianbeam.m Page l A
% gaussianbeam.m plots the gaussian spotsize as a function of distance for a given optical train
%
/o written by Phil Tsai 11-10-99
% last revision 11-10-99
clear element distance
num_optics = request('Enter