Skip to Main Content Skip to Search
Product Documentation

Mathematics

Arrays and MatricesBasic array operators and operations, creation of elementary and specialized arrays and matrices
Linear AlgebraMatrix analysis, linear equations, eigenvalues, singular values, logarithms, exponentials, factorization
Elementary MathTrigonometry, exponentials and logarithms, complex values, rounding, remainders, discrete math
PolynomialsMultiplication, division, evaluation, roots, derivatives, integration, eigenvalue problem, curve fitting, partial fraction expansion
Interpolation and Computational GeometryInterpolation, Delaunay triangulation, convex hulls, Voronoi diagrams, domain generation
Cartesian Coordinate System ConversionConversions between Cartesian and polar or spherical coordinates
Nonlinear Numerical MethodsDifferential equations, optimization, integration
Special FunctionsAiry, Bessel, Jacobi, Legendre, beta, elliptic, error, exponential integral, gamma functions
Sparse MatricesElementary sparse matrices, operations, reordering algorithms, linear algebra, iterative methods, tree operations
Math ConstantsPi, imaginary unit, infinity, Not-a-Number, largest and smallest positive floating point numbers, floating point relative accuracy

Arrays and Matrices

Basic InformationDisplay array contents, get array information, determine array type
OperatorsArithmetic operators
Elementary Matrices and ArraysCreate elementary arrays of different types, generate arrays for plotting, array indexing, etc.
Array OperationsOperate on array content, apply function to each array element, find cumulative product or sum, etc.
Array ManipulationCreate, sort, rotate, permute, reshape, and shift array contents
Specialized MatricesCreate Hadamard, Companion, Hankel, Vandermonde, Pascal matrices, etc.

Basic Information

dispDisplay text or array
displayDisplay text or array (overloaded method)
iscolumnDetermine whether input is column vector
isemptyDetermine whether array is empty
isequalTest arrays for equality
isequalwithequalnansTest arrays for equality, treating NaNs as equal
isfiniteArray elements that are finite
isfloatDetermine whether input is floating-point array
isinfArray elements that are infinite
isintegerDetermine whether input is integer array
islogicalDetermine whether input is logical array
ismatrixDetermine whether input is matrix
isnanArray elements that are NaN
isnumericDetermine whether input is numeric array
isrowDetermine whether input is row vector
isscalarDetermine whether input is scalar
issparseDetermine whether input is sparse
isvectorDetermine whether input is vector
lengthLength of vector or largest array dimension
maxLargest elements in array
minSmallest elements in array
ndimsNumber of array dimensions
numelNumber of elements in array or subscripted array expression
sizeArray dimensions

Operators

Arithmetic Operators + - * / \ ^ 'Matrix and array arithmetic
ctransposeComplex conjugate transpose
minusMinus
mpowerMatrix power
plusPlus
timesArray multiply
transposeTranspose
uminusUnary minus
uplusUnary plus
+Addition
+Unary plus
-Subtraction
-Unary minus
*Matrix multiplication
^Matrix power
\Backslash or left matrix divide
/Slash or right matrix divide
'Transpose
.'Nonconjugated transpose
.*Array multiplication (element-wise)
.^Array power (element-wise)
.\Left array divide (element-wise)
./Right array divide (element-wise)

Elementary Matrices and Arrays

blkdiagConstruct block diagonal matrix from input arguments
colon (:)Create vectors, array subscripting, and for-loop iterators
diagDiagonal matrices and diagonals of matrix
eyeIdentity matrix
freqspaceFrequency spacing for frequency response
ind2subSubscripts from linear index
linspaceGenerate linearly spaced vectors
logspaceGenerate logarithmically spaced vectors
ndgridRectangular grid in N-D space
onesCreate array of all ones
randUniformly distributed pseudorandom numbers
randiUniformly distributed pseudorandom integers
randnNormally distributed pseudorandom numbers
RandStreamRandom number stream
rngControl random number generation
sub2indConvert subscripts to linear indices
zerosCreate array of all zeros

Array Operations

See Linear Algebra and Elementary Math for other array operations.

accumarrayConstruct array with accumulation
arrayfunApply function to each element of array
bsxfunApply element-by-element binary operation to two arrays with singleton expansion enabled
castCast variable to different data type
crossVector cross product
cumprodCumulative product
cumsumCumulative sum
dotVector dot product
idivideInteger division with rounding option
kronKronecker tensor product
prodProduct of array elements
sumSum of array elements
surfnormCompute and display 3-D surface normals
trilLower triangular part of matrix
triuUpper triangular part of matrix

Array Manipulation

blkdiagConstruct block diagonal matrix from input arguments
catConcatenate arrays along specified dimension
circshiftShift array circularly
diagDiagonal matrices and diagonals of matrix
endTerminate block of code, or indicate last array index
flipdimFlip array along specified dimension
fliplrFlip matrix left to right
flipudFlip matrix up to down
horzcatConcatenate arrays horizontally
inlineConstruct inline object
ipermuteInverse permute dimensions of N-D array
permuteRearrange dimensions of N-D array
repmatReplicate and tile array
reshapeReshape array
rot90Rotate matrix 90 degrees
shiftdimShift dimensions
sortSort array elements in ascending or descending order
sortrowsSort rows in ascending order
squeezeRemove singleton dimensions
vectorizeVectorize expression
vertcatConcatenate arrays vertically

Specialized Matrices

companCompanion matrix
galleryTest matrices
hadamardHadamard matrix
hankelHankel matrix
hilbHilbert matrix
invhilbInverse of Hilbert matrix
magicMagic square
pascalPascal matrix
rosserClassic symmetric eigenvalue test problem
toeplitzToeplitz matrix
vanderVandermonde matrix
wilkinsonWilkinson's eigenvalue test matrix

Linear Algebra

Matrix AnalysisCompute norm, rank, determinant, condition number, etc.
Linear EquationsSolve linear systems, least squares, LU factorization, Cholesky factorization, etc.
Eigenvalues and Singular ValuesEigenvalues, eigenvectors, Schur decomposition, Hessenburg matrices, etc.
Matrix Logarithms and ExponentialsMatrix logarithms, exponentials, square root
FactorizationCholesky, LU, and QR factorizations, diagonal forms, singular value decomposition

Matrix Analysis

condCondition number with respect to inversion
condeigCondition number with respect to eigenvalues
detMatrix determinant
normVector and matrix norms
normest2-norm estimate
nullNull space
orthRange space of matrix
rankRank of matrix
rcondMatrix reciprocal condition number estimate
rrefReduced row echelon form
subspaceAngle between two subspaces
traceSum of diagonal elements

Linear Equations

cholCholesky factorization
cholincSparse incomplete Cholesky and Cholesky-Infinity factorizations
condCondition number with respect to inversion
condest1-norm condition number estimate
funmEvaluate general matrix function
icholIncomplete Cholesky factorization
iluSparse incomplete LU factorization
invMatrix inverse
ldl Block LDL' factorization for Hermitian indefinite matrices
linsolveSolve linear system of equations
lscovLeast-squares solution in presence of known covariance
lsqnonnegSolve nonnegative least-squares constraints problem
luLU matrix factorization
luincSparse incomplete LU factorization
pinvMoore-Penrose pseudoinverse of matrix
qrOrthogonal-triangular decomposition
rcondMatrix reciprocal condition number estimate

Eigenvalues and Singular Values

balanceDiagonal scaling to improve eigenvalue accuracy
cdf2rdfConvert complex diagonal form to real block diagonal form
condeigCondition number with respect to eigenvalues
eigEigenvalues and eigenvectors
eigsLargest eigenvalues and eigenvectors of matrix
gsvdGeneralized singular value decomposition
hessHessenberg form of matrix
ordeigEigenvalues of quasitriangular matrices
ordqzReorder eigenvalues in QZ factorization
ordschurReorder eigenvalues in Schur factorization
polyPolynomial with specified roots
polyeigPolynomial eigenvalue problem
rsf2csfConvert real Schur form to complex Schur form
schurSchur decomposition
sqrtmMatrix square root
ss2tfConvert state-space filter parameters to transfer function form
svdSingular value decomposition
svdsFind singular values and vectors

Matrix Logarithms and Exponentials

expmMatrix exponential
logmMatrix logarithm
sqrtmMatrix square root

Factorization

balanceDiagonal scaling to improve eigenvalue accuracy
cdf2rdfConvert complex diagonal form to real block diagonal form
cholCholesky factorization
cholincSparse incomplete Cholesky and Cholesky-Infinity factorizations
cholupdateRank 1 update to Cholesky factorization
gsvdGeneralized singular value decomposition
icholIncomplete Cholesky factorization
iluSparse incomplete LU factorization
ldl Block LDL' factorization for Hermitian indefinite matrices
luLU matrix factorization
luincSparse incomplete LU factorization
planerotGivens plane rotation
qrOrthogonal-triangular decomposition
qrdeleteRemove column or row from QR factorization
qrinsertInsert column or row into QR factorization
qrupdateRank 1 update to QR factorization
qzQZ factorization for generalized eigenvalues
rsf2csfConvert real Schur form to complex Schur form
svdSingular value decomposition

Elementary Math

TrigonometricTrigonometric functions with results in radians or degrees
ExponentialExponential, logarithm, power, and root functions
ComplexNumbers with real and imaginary components, phase angles
Rounding and RemainderRounding, modulus, and remainder
Discrete MathPrime factors, factorials, permutations, rational fractions, least common multiple, greatest common divisor

Trigonometric

acosInverse cosine; result in radians
acosdInverse cosine; result in degrees
acoshInverse hyperbolic cosine
acotInverse cotangent; result in radians
acotdInverse cotangent; result in degrees
acothInverse hyperbolic cotangent
acscInverse cosecant; result in radians
acscdInverse cosecant; result in degrees
acschInverse hyperbolic cosecant
asecInverse secant; result in radians
asecdInverse secant; result in degrees
asechInverse hyperbolic secant
asinInverse sine; result in radians
asindInverse sine; result in degrees
asinhInverse hyperbolic sine
atanInverse tangent; result in radians
atan2Four-quadrant inverse tangent
atandInverse tangent; result in degrees
atanhInverse hyperbolic tangent
cosCosine of argument in radians
cosdCosine of argument in degrees
coshHyperbolic cosine
cotCotangent of argument in radians
cotdCotangent of argument in degrees
cothHyperbolic cotangent
cscCosecant of argument in radians
cscdCosecant of argument in degrees
cschHyperbolic cosecant
hypotSquare root of sum of squares
secSecant of argument in radians
secdSecant of argument in degrees
sechHyperbolic secant
sinSine of argument in radians
sindSine of argument in degrees
sinhHyperbolic sine of argument in radians
tanTangent of argument in radians
tandTangent of argument in degrees
tanhHyperbolic tangent

Exponential

expExponential
expm1Compute exp(x)-1 accurately for small values of x
logNatural logarithm
log10Common (base 10) logarithm
log1pCompute log(1+x) accurately for small values of x
log2Base 2 logarithm and dissect floating-point numbers into exponent and mantissa
nextpow2Next higher power of 2
nthrootReal nth root of real numbers
pow2Base 2 power and scale floating-point numbers
powerArray power
reallogNatural logarithm for nonnegative real arrays
realpowArray power for real-only output
realsqrtSquare root for nonnegative real arrays
sqrtSquare root

Complex

absAbsolute value and complex magnitude
anglePhase angle
complexConstruct complex data from real and imaginary components
conjComplex conjugate
cplxpairSort complex numbers into complex conjugate pairs
iImaginary unit
imagImaginary part of complex number
isrealCheck if input is real array
jImaginary unit
realReal part of complex number
signSignum function
unwrapCorrect phase angles to produce smoother phase plots

Rounding and Remainder

ceilRound toward positive infinity
fixRound toward zero
floorRound toward negative infinity
idivideInteger division with rounding option
modModulus after division
remRemainder after division
roundRound to nearest integer

Discrete Math

factorPrime factors
factorialFactorial function
gcdGreatest common divisor
isprimeArray elements that are prime numbers
lcmLeast common multiple
nchoosekBinomial coefficient or all combinations
permsAll possible permutations
primesGenerate list of prime numbers
rat, ratsRational fraction approximation

Polynomials

convConvolution and polynomial multiplication
deconvDeconvolution and polynomial division
polyPolynomial with specified roots
polyderPolynomial derivative
polyeigPolynomial eigenvalue problem
polyfitPolynomial curve fitting
polyintIntegrate polynomial analytically
polyvalPolynomial evaluation
polyvalmMatrix polynomial evaluation
residueConvert between partial fraction expansion and polynomial coefficients
rootsPolynomial roots

Interpolation and Computational Geometry

InterpolationData interpolation, data gridding, polynomial evaluation, nearest point search
Delaunay TriangulationDelaunay triangulation, triangular surface and mesh plots
Convex HullPlot convex hull, plotting functions
Voronoi DiagramsPlot Voronoi diagram, patch graphics object, plotting functions
Domain GenerationGenerate arrays for 3-D plots, or for N-D functions and interpolation

Interpolation

dsearchSearch Delaunay triangulation for nearest point
dsearchnN-D nearest point search
griddataData gridding
griddata3Data gridding and hypersurface fitting for 3-D data
griddatanData gridding and hypersurface fitting (dimension ≥ 2)
griddedInterpolantInterpolant for gridded data
interp11-D data interpolation (table lookup)
interp1qQuick 1-D linear interpolation
interp22-D data interpolation (table lookup)
interp33-D data interpolation (table lookup)
interpft1-D interpolation using FFT method
interpnN-D data interpolation (table lookup)
meshgridRectangular grid in 2-D and 3-D space
mkppMake piecewise polynomial
ndgridRectangular grid in N-D space
padecoefPadé approximation of time delays
pchipPiecewise Cubic Hermite Interpolating Polynomial (PCHIP)
ppvalEvaluate piecewise polynomial
splineCubic spline data interpolation
TriScatteredInterpInterpolate scattered data
tsearchSearch for enclosing Delaunay triangle
tsearchnN-D closest simplex search
unmkppPiecewise polynomial details

Delaunay Triangulation

delaunayDelaunay triangulation
delaunaynN-D Delaunay triangulation
size (TriRep)Size of triangulation matrix
trimeshTriangular mesh plot
triplot2-D triangular plot
TriRepTriangulation representation
trisurfTriangular surface plot

Convex Hull

convexHull (DelaunayTri)Convex hull
convhullConvex hull
convhullnN-D convex hull
patchCreate one or more filled polygons
trisurfTriangular surface plot

Voronoi Diagrams

patchCreate one or more filled polygons
voronoiVoronoi diagram
voronoiDiagram (DelaunayTri)Voronoi diagram
voronoinN-D Voronoi diagram

Domain Generation

meshgridRectangular grid in 2-D and 3-D space
ndgridRectangular grid in N-D space

Cartesian Coordinate System Conversion

cart2polTransform Cartesian coordinates to polar or cylindrical
cart2sphTransform Cartesian coordinates to spherical
pol2cartTransform polar or cylindrical coordinates to Cartesian
sph2cartTransform spherical coordinates to Cartesian

Nonlinear Numerical Methods

Ordinary Differential EquationsSolve stiff and nonstiff differential equations, define the problem, set solver options, evaluate solution
Delay Differential EquationsSolve delay differential equations with constant and general delays, set solver options, evaluate solution
Boundary Value ProblemsSolve boundary value problems for ordinary differential equations, set solver options, evaluate solution
Partial Differential EquationsSolve initial-boundary value problems for parabolic-elliptic PDEs, evaluate solution
OptimizationFind minimum of single and multivariable functions, solve nonnegative least-squares constraint problem
Numerical Integration (Quadrature)Evaluate Simpson, Lobatto, and vectorized quadratures, evaluate double and triple integrals

Ordinary Differential Equations

decicCompute consistent initial conditions for ode15i
devalEvaluate solution of differential equation problem
ode15iSolve fully implicit differential equations, variable order method
ode23, ode45, ode113, ode15s, ode23s, ode23t, ode23tbSolve initial value problems for ordinary differential equations
odegetOrdinary differential equation options parameters
odesetCreate or alter options structure for ordinary differential equation solvers
odextendExtend solution of initial value problem for ordinary differential equation

Delay Differential Equations

dde23Solve delay differential equations (DDEs) with constant delays
ddegetExtract properties from delay differential equations options structure
ddesdSolve delay differential equations (DDEs) with general delays
ddesetCreate or alter delay differential equations options structure
devalEvaluate solution of differential equation problem

Boundary Value Problems

bvp4cSolve boundary value problems for ordinary differential equations
bvp5cSolve boundary value problems for ordinary differential equations
bvpgetExtract properties from options structure created with bvpset
bvpinitForm initial guess for bvp4c
bvpsetCreate or alter options structure of boundary value problem
bvpxtendForm guess structure for extending boundary value solutions
devalEvaluate solution of differential equation problem

Partial Differential Equations

pdepeSolve initial-boundary value problems for parabolic-elliptic PDEs in 1-D
pdevalEvaluate numerical solution of PDE using output of pdepe

Optimization

fminbndFind minimum of single-variable function on fixed interval
fminsearchFind minimum of unconstrained multivariable function using derivative-free method
fzeroFind root of continuous function of one variable
lsqnonnegSolve nonnegative least-squares constraints problem
optimgetOptimization options values
optimsetCreate or edit optimization options structure

Numerical Integration (Quadrature)

dblquadNumerically evaluate double integral over rectangle
quadNumerically evaluate integral, adaptive Simpson quadrature
quad2dNumerically evaluate double integral over planar region
quadgkNumerically evaluate integral, adaptive Gauss-Kronrod quadrature
quadlNumerically evaluate integral, adaptive Lobatto quadrature
quadvVectorized quadrature
triplequadNumerically evaluate triple integral

Special Functions

airyAiry functions
besselhBessel function of third kind (Hankel function)
besseliModified Bessel function of first kind
besseljBessel function of first kind
besselkModified Bessel function of second kind
besselyBessel function of second kind
betaBeta function
betaincIncomplete beta function
betaincinvBeta inverse cumulative distribution function
betalnLogarithm of beta function
ellipjJacobi elliptic functions
ellipkeComplete elliptic integrals of first and second kind
erfError function
erfcComplementary error function
erfcinvInverse complementary error function
erfcxScaled complementary error function
erfinvInverse error function
expintExponential integral
gammaGamma function
gammaincIncomplete gamma function
gammaincinvInverse incomplete gamma function
gammalnLogarithm of gamma function
legendreAssociated Legendre functions

Sparse Matrices

Elementary Sparse MatricesCreate random and nonrandom sparse matrices
Full to Sparse ConversionConvert full matrix to sparse, sparse matrix to full
Sparse Matrix ManipulationTest matrix for sparseness, get information on sparse matrix, allocate sparse matrix, apply function to nonzero elements, visualize sparsity pattern
Reordering AlgorithmsRandom, column, minimum degree, Dulmage-Mendelsohn, and reverse Cuthill-McKee permutations
Linear AlgebraCompute norms, eigenvalues, factorizations, least squares, structural rank
Linear Equations (Iterative Methods)Methods for conjugate and biconjugate gradients, residuals, lower quartile
Tree OperationsElimination trees, tree plotting, factorization analysis

Elementary Sparse Matrices

spdiagsExtract and create sparse band and diagonal matrices
speyeSparse identity matrix
sprandSparse uniformly distributed random matrix
sprandnSparse normally distributed random matrix
sprandsymSparse symmetric random matrix

Full to Sparse Conversion

findFind indices and values of nonzero elements
fullConvert sparse matrix to full matrix
sparseCreate sparse matrix
spconvertImport matrix from sparse matrix external format

Sparse Matrix Manipulation

issparseDetermine whether input is sparse
nnzNumber of nonzero matrix elements
nonzerosNonzero matrix elements
nzmaxAmount of storage allocated for nonzero matrix elements
spallocAllocate space for sparse matrix
spfunApply function to nonzero sparse matrix elements
sponesReplace nonzero sparse matrix elements with ones
spparmsSet parameters for sparse matrix routines
spyVisualize sparsity pattern

Reordering Algorithms

amdApproximate minimum degree permutation
colamdColumn approximate minimum degree permutation
colpermSparse column permutation based on nonzero count
dmpermDulmage-Mendelsohn decomposition
ldl Block LDL' factorization for Hermitian indefinite matrices
randpermRandom permutation
symamdSymmetric approximate minimum degree permutation
symrcmSparse reverse Cuthill-McKee ordering

Linear Algebra

cholincSparse incomplete Cholesky and Cholesky-Infinity factorizations
condest1-norm condition number estimate
eigsLargest eigenvalues and eigenvectors of matrix
icholIncomplete Cholesky factorization
iluSparse incomplete LU factorization
luincSparse incomplete LU factorization
normest2-norm estimate
spaugmentForm least squares augmented system
sprankStructural rank
svdsFind singular values and vectors

Linear Equations (Iterative Methods)

bicgBiconjugate gradients method
bicgstabBiconjugate gradients stabilized method
bicgstablBiconjugate gradients stabilized (l) method
cgsConjugate gradients squared method
gmresGeneralized minimum residual method (with restarts)
lsqrLSQR method
minresMinimum residual method
pcgPreconditioned conjugate gradients method
qmrQuasi-minimal residual method
symmlqSymmetric LQ method
tfqmrTranspose-free quasi-minimal residual method

Tree Operations

etreeElimination tree
etreeplotPlot elimination tree
gplotPlot nodes and links representing adjacency matrix
symbfactSymbolic factorization analysis
treelayoutLay out tree or forest
treeplotPlot picture of tree
unmeshConvert edge matrix to coordinate and Laplacian matrices

Math Constants

epsFloating-point relative accuracy
iImaginary unit
InfInfinity
intmaxLargest value of specified integer type
intminSmallest value of specified integer type
jImaginary unit
NaNNot-a-Number
piRatio of circle's circumference to its diameter
realmaxLargest positive floating-point number
realminSmallest positive normalized floating-point number
  


» Learn more
» Download free kit
» Get trial software

 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS