MATLAB Functions
Language Fundamentals
Entering Commands
| ans |
Most recent answer |
| clc |
Clear Command Window |
| diary |
Save Command Window text to file |
| format |
Set display format for output |
| home |
Send cursor home |
| iskeyword |
Determine whether input is MATLAB keyword |
| more |
Control paged output for Command Window |
| commandhistory |
Open Command History window, or select it if already open |
| commandwindow |
Open Command Window, or select it if already open |
Matrices and Arrays
Array Creation and Concatenation
| accumarray |
Construct array with accumulation |
| blkdiag |
Construct block diagonal matrix from input arguments |
| diag |
Diagonal matrices and diagonals of matrix |
| eye |
Identity matrix |
| false |
Logical 0 (false) |
| freqspace |
Frequency spacing for frequency response |
| linspace |
Generate linearly spaced vectors |
| logspace |
Generate logarithmically spaced vectors |
| meshgrid |
Rectangular grid in 2-D and 3-D space |
| ndgrid |
Rectangular grid in N-D space |
| ones |
Create array of all ones |
| rand |
Uniformly distributed pseudorandom numbers |
| true |
Logical 1 (true) |
| zeros |
Create array of all zeros |
| cat |
Concatenate arrays along specified dimension |
| horzcat |
Concatenate arrays horizontally |
| vertcat |
Concatenate arrays vertically |
Indexing
| colon |
Create vectors, array subscripting, and for-loop
iterators |
| end |
Terminate block of code, or indicate last array index |
| ind2sub |
Subscripts from linear index |
| sub2ind |
Convert subscripts to linear indices |
Array Dimensions
| length |
Length of vector or largest array dimension |
| ndims |
Number of array dimensions |
| numel |
Number of array elements |
| size |
Array dimensions |
| iscolumn |
Determine whether input
is column vector |
| isempty |
Determine whether array is empty |
| ismatrix |
Determine whether input
is matrix |
| isrow |
Determine whether input
is row vector |
| isscalar |
Determine whether input is scalar |
| isvector |
Determine whether input is vector |
Sorting and Reshaping Arrays
| blkdiag |
Construct block diagonal matrix from input arguments |
| circshift |
Shift array circularly |
| ctranspose |
Complex conjugate transpose |
| diag |
Diagonal matrices and diagonals of matrix |
| flipdim |
Flip array along specified dimension |
| fliplr |
Flip matrix left to right |
| flipud |
Flip matrix up to down |
| ipermute |
Inverse permute dimensions of N-D array |
| permute |
Rearrange dimensions of N-D array |
| repmat |
Replicate and tile array |
| reshape |
Reshape array |
| rot90 |
Rotate matrix 90 degrees |
| shiftdim |
Shift dimensions |
| issorted |
Determine whether set elements are in sorted order |
| sort |
Sort array elements in ascending or descending order |
| sortrows |
Sort rows in ascending order |
| squeeze |
Remove singleton dimensions |
| transpose |
Transpose |
| vectorize |
Vectorize expression |
Operators and Elementary Operations
Arithmetic
Relational Operations
| Relational
Operators |
Relational operations |
| eq |
Test for equality |
| ge |
Test for greater than or equal to |
| gt |
Test for greater than |
| le |
Test for less than or equal to |
| lt |
Test for less than |
| ne |
Test for inequality |
| isequal |
Test arrays for equality |
| isequaln |
Test arrays for equality, treating NaN values as equal |
Logical Operations
| Logical
Operators: Elementwise |
Elementwise logical operations on arrays |
| Logical
Operators: Short-circuit |
Logical operations, with short-circuiting capability |
| and |
Find logical AND of array or scalar inputs |
| not |
Find logical NOT of array or scalar input |
| or |
Find logical OR of array or scalar inputs |
| xor |
Logical exclusive-OR |
| all |
Determine if all array elements are nonzero or true |
| any |
Determine if any array elements are nonzero |
| false |
Logical 0 (false) |
| find |
Find indices and values of nonzero elements |
| islogical |
Determine if input is logical array |
| logical |
Convert numeric values to logical |
| true |
Logical 1 (true) |
Set Operations
| intersect |
Set intersection of two arrays |
| ismember |
Array elements that are members of set array |
| issorted |
Determine whether set elements are in sorted order |
| setdiff |
Set difference of two arrays |
| setxor |
Set exclusive OR of two arrays |
| union |
Set union of two arrays |
| unique |
Unique values in array |
Bit-Wise Operations
Special Characters
Data Types
Numeric Types
| double |
Convert to double precision |
| single |
Convert to single precision |
| int8 |
Convert to 8-bit signed integer |
| int16 |
Convert to 16-bit signed integer |
| int32 |
Convert to 32-bit signed integer |
| int64 |
Convert to 64-bit signed integer |
| uint8 |
Convert to 8-bit unsigned integer |
| uint16 |
Convert to 16-bit unsigned integer |
| uint32 |
Convert to 32-bit unsigned integer |
| uint64 |
Convert to 64-bit unsigned integer |
| cast |
Cast variable to different data type |
| typecast |
Convert data types without changing underlying data |
| isinteger |
Determine if input is integer array |
| isfloat |
Determine if input is floating-point array |
| isnumeric |
Determine if input is numeric array |
| isreal |
Check if input is real array |
| isfinite |
Array elements that are finite |
| isinf |
Array elements that are infinite |
| isnan |
Array elements that are NaN |
| eps |
Floating-point relative accuracy |
| flintmax |
Largest consecutive integer in floating-point format |
| Inf |
Infinity |
| intmax |
Largest value of specified integer type |
| intmin |
Smallest value of specified integer type |
| NaN |
Not-a-Number |
| realmax |
Largest positive floating-point number |
| realmin |
Smallest positive normalized floating-point number |
Characters and Strings
Create and Concatenate Strings
| blanks |
Create string of blank characters |
| cellstr |
Create cell array of strings from character array |
| char |
Convert to character array (string) |
| iscellstr |
Determine whether input is cell array of strings |
| ischar |
Determine whether item is character array |
| sprintf |
Format data into string |
| strcat |
Concatenate strings horizontally |
| strjoin |
Join strings in cell array into single string |
Parse Strings
| ischar |
Determine whether item is character array |
| isletter |
Array elements that are alphabetic letters |
| isspace |
Array elements that are space characters |
| isstrprop |
Determine whether string is of specified category |
| sscanf |
Read formatted data from string |
| strfind |
Find one string within another |
| strrep |
Find and replace substring |
| strsplit |
Split string at specified delimiter |
| strtok |
Selected parts of string |
| validatestring |
Check validity of text string |
| symvar |
Determine symbolic variables in expression |
| regexp |
Match regular expression (case sensitive) |
| regexpi |
Match regular expression (case insensitive) |
| regexprep |
Replace string using regular expression |
| regexptranslate |
Translate string into regular expression |
Compare Strings
| strcmp |
Compare strings (case sensitive) |
| strcmpi |
Compare strings (case insensitive) |
| strncmp |
Compare first n characters of strings
(case sensitive) |
| strncmpi |
Compare first n characters of strings
(case insensitive) |
Change String Case, Blanks, and Justification
| blanks |
Create string of blank characters |
| deblank |
Strip trailing blanks from end of string |
| strtrim |
Remove leading and trailing white space from string |
| lower |
Convert string to lowercase |
| upper |
Convert string to uppercase |
| strjust |
Justify character array |
Structures
| struct |
Create structure array |
| fieldnames |
Field names of structure, or public fields of object |
| getfield |
Field of structure array |
| isfield |
Determine whether input is structure array field |
| isstruct |
Determine whether input is structure array |
| orderfields |
Order fields of structure array |
| rmfield |
Remove fields from structure |
| setfield |
Assign values to structure array field |
| arrayfun |
Apply function to each element of array |
| structfun |
Apply function to each field of scalar structure |
| cell2struct |
Convert cell array to structure array |
| struct2cell |
Convert structure to cell array |
Cell Arrays
| cell |
Create cell array |
| cell2mat |
Convert cell array to numeric array |
| cell2struct |
Convert cell array to structure array |
| celldisp |
Cell array contents |
| cellfun |
Apply function to each cell in cell array |
| cellplot |
Graphically display structure of cell array |
| cellstr |
Create cell array of strings from character array |
| iscell |
Determine whether input is cell array |
| iscellstr |
Determine whether input is cell array of strings |
| mat2cell |
Convert array to cell array with potentially different
sized cells |
| num2cell |
Convert array to cell array with consistently sized cells |
| strjoin |
Join strings in cell array into single string |
| strsplit |
Split string at specified delimiter |
| struct2cell |
Convert structure to cell array |
Function Handles
| function_handle
(@) |
Handle used in calling functions indirectly |
| feval |
Evaluate function |
| func2str |
Construct function name string from function handle |
| str2func |
Construct function handle from function name string |
| functions |
Information about function handle |
Map Containers
| containers.Map |
Map values to unique keys |
| isKey |
Determine if containers.Map object
contains key |
| keys |
Identify keys of containers.Map object |
| remove |
Remove key-value pairs from containers.Map object |
| values |
Identify values in containers.Map object |
Time Series
Time Series Basics
| append |
Concatenate time series objects in time dimension |
| get |
Query timeseries object property values |
| getdatasamplesize |
Size of data sample in timeseries object |
| getqualitydesc |
Data quality descriptions |
| getsamples |
Subset of time series samples using subscripted index
array |
| plot |
Plot time series |
| set |
Set properties of timeseries object |
| tsdata.event |
Construct event object for timeseries object |
| tstool |
Open Time Series Tools GUI |
| timeseries |
|
Data Manipulation
| addsample |
Add data sample to timeseries object |
| ctranspose |
Transpose timeseries object |
| delsample |
Remove sample from timeseries object |
| detrend |
Subtract mean or best-fit line and all NaNs
from timeseries object |
| filter |
Shape frequency content of time-series |
| getabstime |
Extract date-string time vector into cell array |
| getinterpmethod |
Interpolation method for timeseries object |
| getsampleusingtime |
Extract data samples into new timeseries object |
| idealfilter |
Apply ideal (noncausal) filter to timeseries object |
| resample |
Select or interpolate timeseries data
using new time vector |
| setabstime |
Set times of timeseries object as date
strings |
| setinterpmethod |
Set default interpolation method for timeseries object |
| synchronize |
Synchronize and resample two timeseries objects
using common time vector |
| transpose |
Transpose timeseries object |
Event Data
Descriptive Statistics
| iqr |
Interquartile range of timeseries data |
| max |
Maximum value of timeseries data |
| mean |
Mean value of timeseries data |
| median |
Median value of timeseries data |
| min |
Minimum value of timeseries data |
| std |
Standard deviation of timeseries data |
| sum |
Sum of timeseries data |
| var |
Variance of timeseries data |
Time Series Collections
Data Type Identification
| is* |
Detect state |
| isa |
Determine if input is object of specified class |
| iscell |
Determine whether input is cell array |
| iscellstr |
Determine whether input is cell array of strings |
| ischar |
Determine whether item is character array |
| isfield |
Determine whether input is structure array field |
| isfloat |
Determine if input is floating-point array |
| ishghandle |
True for Handle Graphics object handles |
| isinteger |
Determine if input is integer array |
| isjava |
Determine if input is Java object |
| islogical |
Determine if input is logical array |
| isnumeric |
Determine if input is numeric array |
| isobject |
Determine if input is MATLAB object |
| isreal |
Check if input is real array |
| isscalar |
Determine whether input is scalar |
| isstr |
Determine whether input is character array |
| isstruct |
Determine whether input is structure array |
| isvector |
Determine whether input is vector |
| class |
Determine class of object |
| validateattributes |
Check validity of array |
| whos |
List variables in workspace, with sizes and types |
Data Type Conversion
| char |
Convert to character array (string) |
| int2str |
Convert integer to string |
| mat2str |
Convert matrix to string |
| num2str |
Convert number to string |
| str2double |
Convert string to double-precision value |
| str2num |
Convert string to number |
| native2unicode |
Convert numeric bytes to Unicode characters |
| unicode2native |
Convert Unicode characters to numeric bytes |
| base2dec |
Convert base N number string to decimal number |
| bin2dec |
Convert binary number string to decimal number |
| dec2base |
Convert decimal to base N number in string |
| dec2bin |
Convert decimal to binary number in string |
| dec2hex |
Convert decimal to hexadecimal number in string |
| hex2dec |
Convert hexadecimal number string to decimal number |
| hex2num |
Convert hexadecimal number string to double-precision
number |
| num2hex |
Convert singles and doubles to IEEE hexadecimal strings |
| cell2mat |
Convert cell array to numeric array |
| cell2struct |
Convert cell array to structure array |
| cellstr |
Create cell array of strings from character array |
| mat2cell |
Convert array to cell array with potentially different
sized cells |
| num2cell |
Convert array to cell array with consistently sized cells |
| struct2cell |
Convert structure to cell array |
Dates and Time
| datenum |
Convert date and time to serial date number |
| datevec |
Convert date and time to vector of components |
| datestr |
Convert date and time to string format |
| now |
Current date and time as serial date number |
| clock |
Current date and time as date vector |
| date |
Current date string |
| calendar |
Calendar for specified month |
| eomday |
Last day of month |
| weekday |
Day of week |
| addtodate |
Modify date number by field |
| etime |
Time elapsed between date vectors |
Mathematics
Elementary Math
Arithmetic
| uplus |
Unary plus |
| plus |
Plus |
| uminus |
Unary minus |
| minus |
Minus |
| mtimes |
Matrix multiplication |
| times |
Array multiply |
| rdivide |
Right array division |
| mrdivide |
Solve systems of linear equations xA = B for x |
| ldivide |
Left array division |
| mldivide |
Solve systems of linear equations Ax = B for x |
| power |
Array power |
| mpower |
Matrix power |
| cumprod |
Cumulative product |
| cumsum |
Cumulative sum |
| diff |
Differences and approximate derivatives |
| prod |
Product of array elements |
| sum |
Sum of array elements |
| ceil |
Round toward positive infinity |
| fix |
Round toward zero |
| floor |
Round toward negative infinity |
| idivide |
Integer division with rounding option |
| mod |
Modulus after division |
| rem |
Remainder after division |
| round |
Round to nearest integer |
Trigonometry
| sin |
Sine of argument in radians |
| sind |
Sine of argument in degrees |
| asin |
Inverse sine in radians |
| asind |
Inverse sine in degrees |
| sinh |
Hyperbolic sine of argument in radians |
| asinh |
Inverse hyperbolic sine |
| cos |
Cosine of argument in radians |
| cosd |
Cosine of argument in degrees |
| acos |
Inverse cosine in radians |
| acosd |
Inverse cosine in degrees |
| cosh |
Hyperbolic cosine |
| acosh |
Inverse hyperbolic cosine |
| tan |
Tangent of argument in radians |
| tand |
Tangent of argument in degrees |
| atan |
Inverse tangent in radians |
| atand |
Inverse tangent in degrees |
| atan2 |
Four-quadrant inverse tangent |
| atan2d |
Four-quadrant inverse tangent in degrees |
| tanh |
Hyperbolic tangent |
| atanh |
Inverse hyperbolic tangent |
| csc |
Cosecant of argument in radians |
| cscd |
Cosecant of argument in degrees |
| acsc |
Inverse cosecant in radians |
| acscd |
Inverse cosecant in degrees |
| csch |
Hyperbolic cosecant |
| acsch |
Inverse hyperbolic cosecant |
| sec |
Secant of argument in radians |
| secd |
Secant of argument in degrees |
| asec |
Inverse secant in radians |
| asecd |
Inverse secant in degrees |
| sech |
Hyperbolic secant |
| asech |
Inverse hyperbolic secant |
| cot |
Cotangent of argument in radians |
| cotd |
Cotangent of argument in degrees |
| acot |
Inverse cotangent in radians |
| acotd |
Inverse cotangent in degrees |
| coth |
Hyperbolic cotangent |
| acoth |
Inverse hyperbolic cotangent |
| hypot |
Square root of sum of squares |
Exponents and Logarithms
| exp |
Exponential |
| expm1 |
Compute exp(x)-1 accurately for small values of x |
| log |
Natural logarithm |
| log10 |
Common (base 10) logarithm |
| log1p |
Compute log(1+x) accurately for small values of x |
| log2 |
Base 2 logarithm and dissect floating-point numbers into
exponent and mantissa |
| nextpow2 |
Exponent of next higher power of 2 |
| nthroot |
Real nth root of real numbers |
| pow2 |
Base 2 power and scale floating-point numbers |
| reallog |
Natural logarithm for nonnegative real arrays |
| realpow |
Array power for real-only output |
| realsqrt |
Square root for nonnegative real arrays |
| sqrt |
Square root |
Complex Numbers
| abs |
Absolute value and complex magnitude |
| angle |
Phase angle |
| complex |
Construct complex data from real and imaginary components |
| conj |
Complex conjugate |
| cplxpair |
Sort complex numbers into complex conjugate pairs |
| i |
Imaginary unit |
| imag |
Imaginary part of complex number |
| isreal |
Check if input is real array |
| j |
Imaginary unit |
| real |
Real part of complex number |
| sign |
Signum function |
| unwrap |
Correct phase angles to produce smoother phase plots |
Discrete Math
| factor |
Prime factors |
| factorial |
Factorial of input |
| gcd |
Greatest common divisor |
| isprime |
Determine which array elements are prime |
| lcm |
Least common multiple |
| nchoosek |
Binomial coefficient or all combinations |
| perms |
All possible permutations |
| primes |
Prime numbers less than or equal to input value |
| rat, rats |
Rational fraction approximation |
Polynomials
| poly |
Polynomial with specified roots |
| polyder |
Polynomial derivative |
| polyeig |
Polynomial eigenvalue problem |
| polyfit |
Polynomial curve fitting |
| polyint |
Integrate polynomial analytically |
| polyval |
Polynomial evaluation |
| polyvalm |
Matrix polynomial evaluation |
| residue |
Convert between partial fraction expansion and polynomial
coefficients |
| roots |
Polynomial roots |
Special Functions
| airy |
Airy Functions |
| besselh |
Bessel function of third kind (Hankel function) |
| besseli |
Modified Bessel function of first kind |
| besselj |
Bessel function of first kind |
| besselk |
Modified Bessel function of second kind |
| bessely |
Bessel function of second kind |
| beta |
Beta function |
| betainc |
Incomplete beta function |
| betaincinv |
Beta inverse cumulative distribution function |
| betaln |
Logarithm of beta function |
| ellipj |
Jacobi elliptic functions |
| ellipke |
Complete elliptic integrals of first and second kind |
| erf |
Error function |
| erfc |
Complementary error function |
| erfcinv |
Inverse complementary error function |
| erfcx |
Scaled complementary error function |
| erfinv |
Inverse error function |
| expint |
Exponential integral |
| gamma |
Gamma function |
| gammainc |
Incomplete gamma function |
| gammaincinv |
Inverse incomplete gamma function |
| gammaln |
Logarithm of gamma function |
| legendre |
Associated Legendre functions |
| psi |
Psi (polygamma) function |
Cartesian Coordinate System Conversion
| cart2pol |
Transform Cartesian coordinates to polar or cylindrical |
| cart2sph |
Transform Cartesian coordinates to spherical |
| pol2cart |
Transform polar or cylindrical coordinates to Cartesian |
| sph2cart |
Transform spherical coordinates to Cartesian |
Constants and Test Matrices
| eps |
Floating-point relative accuracy |
| flintmax |
Largest consecutive integer in floating-point format |
| i |
Imaginary unit |
| j |
Imaginary unit |
| Inf |
Infinity |
| pi |
Ratio of circle's circumference to its diameter |
| NaN |
Not-a-Number |
| isfinite |
Array elements that are finite |
| isinf |
Array elements that are infinite |
| isnan |
Array elements that are NaN |
| compan |
Companion matrix |
| gallery |
Test matrices |
| hadamard |
Hadamard matrix |
| hankel |
Hankel matrix |
| hilb |
Hilbert matrix |
| invhilb |
Inverse of Hilbert matrix |
| magic |
Magic square |
| pascal |
Pascal matrix |
| rosser |
Classic symmetric eigenvalue test problem |
| toeplitz |
Toeplitz matrix |
| vander |
Vandermonde matrix |
| wilkinson |
Wilkinson's eigenvalue test matrix |
Linear Algebra
Matrix Operations
| cross |
Vector cross product |
| dot |
Vector dot product |
| kron |
Kronecker tensor product |
| surfnorm |
Compute and display 3-D
surface normals |
| tril |
Lower triangular part of matrix |
| triu |
Upper triangular part of matrix |
| transpose |
Transpose |
Linear Equations
| cond |
Condition number with respect to inversion |
| condest |
1-norm condition number estimate |
| funm |
Evaluate general matrix function |
| inv |
Matrix inverse |
| linsolve |
Solve linear system of equations |
| lscov |
Least-squares solution in presence of known covariance |
| lsqnonneg |
Solve nonnegative least-squares constraints problem |
| pinv |
Moore-Penrose pseudoinverse of matrix |
| rcond |
Matrix reciprocal condition number estimate |
| mldivide |
Solve systems of linear equations Ax = B for x |
| mrdivide |
Solve systems of linear equations xA = B for x |
Matrix Decomposition
| chol |
Cholesky factorization |
| ichol |
Incomplete Cholesky factorization |
| cholupdate |
Rank 1 update to Cholesky factorization |
| ilu |
Sparse incomplete LU factorization |
| lu |
LU matrix factorization |
| qr |
Orthogonal-triangular decomposition |
| qrdelete |
Remove column or row from QR factorization |
| qrinsert |
Insert column or row into QR factorization |
| qrupdate |
Rank 1 update to QR factorization |
| planerot |
Givens plane rotation |
| ldl |
Block LDL' factorization for Hermitian indefinite matrices |
| cdf2rdf |
Convert complex diagonal form to real block diagonal form |
| rsf2csf |
Convert real Schur form to complex Schur form |
| gsvd |
Generalized singular value decomposition |
| svd |
Singular value decomposition |
Eigenvalues and Singular Values
| balance |
Diagonal scaling to improve eigenvalue accuracy |
| cdf2rdf |
Convert complex diagonal form to real block diagonal form |
| condeig |
Condition number with respect to eigenvalues |
| eig |
Eigenvalues and eigenvectors |
| eigs |
Largest eigenvalues and eigenvectors of matrix |
| gsvd |
Generalized singular value decomposition |
| hess |
Hessenberg form of matrix |
| ordeig |
Eigenvalues of quasitriangular matrices |
| ordqz |
Reorder eigenvalues in QZ factorization |
| ordschur |
Reorder eigenvalues in Schur factorization |
| poly |
Polynomial with specified roots |
| polyeig |
Polynomial eigenvalue problem |
| qz |
QZ factorization for generalized eigenvalues |
| rsf2csf |
Convert real Schur form to complex Schur form |
| schur |
Schur decomposition |
| sqrtm |
Matrix square root |
| ss2tf |
Convert state-space filter parameters to transfer function
form |
| svd |
Singular value decomposition |
| svds |
Find singular values and vectors |
Matrix Analysis
| cond |
Condition number with respect to inversion |
| condeig |
Condition number with respect to eigenvalues |
| det |
Matrix determinant |
| norm |
Vector and matrix norms |
| normest |
2-norm estimate |
| null |
Null space |
| orth |
Range space of matrix |
| rank |
Rank of matrix |
| rcond |
Matrix reciprocal condition number estimate |
| rref |
Reduced row echelon form |
| subspace |
Angle between two subspaces |
| trace |
Sum of diagonal elements |
Matrix Functions
| expm |
Matrix exponential |
| logm |
Matrix logarithm |
| sqrtm |
Matrix square root |
| bsxfun |
Apply element-by-element binary operation to two arrays
with singleton expansion enabled |
| arrayfun |
Apply function to each element of array |
| accumarray |
Construct array with accumulation |
| mpower |
Matrix power |
Statistics and Random Numbers
Descriptive Statistics
| corrcoef |
Correlation coefficients |
| cov |
Covariance matrix |
| max |
Largest elements in array |
| mean |
Average or mean value of array |
| median |
Median value of array |
| min |
Smallest elements in array |
| mode |
Most frequent values in array |
| std |
Standard deviation |
| var |
Variance |
Random Number Generation
| rng |
Control random number generation |
| rand |
Uniformly distributed pseudorandom numbers |
| randn |
Normally distributed pseudorandom numbers |
| randi |
Uniformly distributed pseudorandom integers |
| RandStream |
Random number stream |
| randperm |
Random permutation |
Interpolation
1-D Interpolation
| interp1 |
1-D data interpolation (table lookup) |
| griddedInterpolant |
Gridded data interpolation |
| pchip |
Piecewise Cubic Hermite Interpolating Polynomial (PCHIP) |
| spline |
Cubic spline data interpolation |
| ppval |
Evaluate piecewise polynomial |
| mkpp |
Make piecewise polynomial |
| unmkpp |
Piecewise polynomial details |
| padecoef |
Padé approximation of time delays |
| interpft |
1-D interpolation using FFT method |
Gridded Data Interpolation
| interp2 |
Interpolation for 2-D gridded data in meshgrid format |
| interp3 |
Interpolation for 3-D gridded data in meshgrid format |
| interpn |
Interpolation for 1-D, 2-D, 3-D, and N-D gridded data
in ndgrid format |
| griddedInterpolant |
Gridded data interpolation |
| ndgrid |
Rectangular grid in N-D space |
| meshgrid |
Rectangular grid in 2-D and 3-D space |
Scattered Data Interpolation
Optimization
| fminbnd |
Find minimum of single-variable function on fixed interval |
| fminsearch |
Find minimum of unconstrained multivariable function using
derivative-free method |
| fzero |
Root of nonlinear function |
| lsqnonneg |
Solve nonnegative least-squares constraints problem |
| optimget |
Optimization options values |
| optimset |
Create or edit optimization options structure |
Numerical Integration and Differential Equations
Ordinary Differential Equations
| ode45 |
Solve nonstiff differential equations; medium order method |
| ode15s |
Solve stiff differential equations and DAEs; variable
order method |
| ode23 |
Solve nonstiff differential equations; low order method |
| ode113 |
Solve nonstiff differential equations; variable order
method |
| ode23t |
Solve moderately stiff ODEs and DAEs; trapezoidal rule |
| ode23tb |
Solve stiff differential equations; low order method |
| ode23s |
Solve stiff differential equations; low order method |
| ode15i |
Solve fully implicit differential equations, variable
order method |
| decic |
Compute consistent initial conditions for ode15i |
| odextend |
Extend solution of initial value problem for ordinary
differential equation |
| odeget |
Ordinary differential equation options parameters |
| odeset |
Create or alter options structure for ordinary differential
equation solvers |
| deval |
Evaluate solution of differential equation problem |
Boundary Value Problems
| bvp4c |
Solve boundary value problems for ordinary differential
equations |
| bvp5c |
Solve boundary value problems for ordinary differential
equations |
| bvpinit |
Form initial guess for BVP solvers |
| bvpxtend |
Form guess structure for extending boundary value solutions |
| bvpget |
Extract properties from options structure created with
bvpset |
| bvpset |
Create or alter options structure of boundary value problem |
| deval |
Evaluate solution of differential equation problem |
Delay Differential Equations
| dde23 |
Solve delay differential equations (DDEs) with constant
delays |
| ddesd |
Solve delay differential equations (DDEs) with general
delays |
| ddensd |
Solve delay differential equations (DDEs) of neutral type |
| ddeget |
Extract properties from delay differential equations options
structure |
| ddeset |
Create or alter delay differential equations options structure |
| deval |
Evaluate solution of differential equation problem |
Partial Differential Equations
| pdepe |
Solve initial-boundary value problems for parabolic-elliptic
PDEs in 1-D |
| pdeval |
Evaluate numerical solution of PDE using output of pdepe |
Numerical Integration and Differentiation
| integral |
Numerically evaluate integral |
| integral2 |
Numerically evaluate double integral |
| integral3 |
Numerically evaluate triple integral |
| quadgk |
Numerically evaluate integral, adaptive Gauss-Kronrod
quadrature |
| quad2d |
Numerically evaluate double integral, tiled method |
| cumtrapz |
Cumulative trapezoidal numerical integration |
| trapz |
Trapezoidal numerical integration |
| polyint |
Integrate polynomial analytically |
| del2 |
Discrete Laplacian |
| diff |
Differences and approximate derivatives |
| gradient |
Numerical gradient |
| polyder |
Polynomial derivative |
Fourier Analysis and Filtering
| abs |
Absolute value and complex magnitude |
| angle |
Phase angle |
| cplxpair |
Sort complex numbers into complex conjugate pairs |
| fft |
Fast Fourier transform |
| fft2 |
2-D fast Fourier transform |
| fftn |
N-D fast Fourier transform |
| fftshift |
Shift zero-frequency component to center of spectrum |
| fftw |
Interface to FFTW library run-time algorithm tuning control |
| ifft |
Inverse fast Fourier transform |
| ifft2 |
2-D inverse fast Fourier transform |
| ifftn |
N-D inverse fast Fourier transform |
| ifftshift |
Inverse FFT shift |
| nextpow2 |
Exponent of next higher power of 2 |
| unwrap |
Correct phase angles to produce smoother phase plots |
| conv |
Convolution and polynomial multiplication |
| conv2 |
2-D convolution |
| convn |
N-D convolution |
| deconv |
Deconvolution and polynomial division |
| detrend |
Remove linear trends |
| filter |
1-D digital filter |
| filter2 |
2-D digital filter |
Sparse Matrices
Sparse Matrix Creation
| spdiags |
Extract and create sparse band and diagonal matrices |
| speye |
Sparse identity matrix |
| sprand |
Sparse uniformly distributed random matrix |
| sprandn |
Sparse normally distributed random matrix |
| sprandsym |
Sparse symmetric random matrix |
| sparse |
Create sparse matrix |
| spconvert |
Import matrix from sparse matrix external format |
Sparse Matrix Manipulation
| issparse |
Determine whether input is sparse |
| nnz |
Number of nonzero matrix elements |
| nonzeros |
Nonzero matrix elements |
| nzmax |
Amount of storage allocated for nonzero matrix elements |
| spalloc |
Allocate space for sparse matrix |
| spfun |
Apply function to nonzero sparse matrix elements |
| spones |
Replace nonzero sparse matrix elements with ones |
| spparms |
Set parameters for sparse matrix routines |
| spy |
Visualize sparsity pattern |
| find |
Find indices and values of nonzero elements |
| full |
Convert sparse matrix to full matrix |
Reordering Algorithms
| amd |
Approximate minimum degree permutation |
| colamd |
Column approximate minimum degree permutation |
| colperm |
Sparse column permutation based on nonzero count |
| dmperm |
Dulmage-Mendelsohn decomposition |
| randperm |
Random permutation |
| symamd |
Symmetric approximate minimum degree permutation |
| symrcm |
Sparse reverse Cuthill-McKee ordering |
Sparse Linear Algebra
| condest |
1-norm condition number estimate |
| eigs |
Largest eigenvalues and eigenvectors of matrix |
| ichol |
Incomplete Cholesky factorization |
| ilu |
Sparse incomplete LU factorization |
| normest |
2-norm estimate |
| spaugment |
Form least squares augmented system |
| sprank |
Structural rank |
| svds |
Find singular values and vectors |
Linear Equations (Iterative Methods)
| bicg |
Biconjugate gradients method |
| bicgstab |
Biconjugate gradients stabilized method |
| bicgstabl |
Biconjugate gradients stabilized (l) method |
| cgs |
Conjugate gradients squared method |
| gmres |
Generalized minimum residual method (with restarts) |
| lsqr |
LSQR method |
| minres |
Minimum residual method |
| pcg |
Preconditioned conjugate gradients method |
| qmr |
Quasi-minimal residual method |
| symmlq |
Symmetric LQ method |
| tfqmr |
Transpose-free quasi-minimal residual method |
Graph and Tree Algorithms
| etree |
Elimination tree |
| etreeplot |
Plot elimination tree |
| gplot |
Plot nodes and links representing adjacency matrix |
| symbfact |
Symbolic factorization analysis |
| treelayout |
Lay out tree or forest |
| treeplot |
Plot picture of tree |
| unmesh |
Convert edge matrix to coordinate and Laplacian matrices |
Computational Geometry
Triangulation Representation
Delaunay Triangulation
Spatial Search
Convex Hull
Voronoi Diagram
Elementary Polygons
Graphics
2-D and 3-D Plots
Line Plots
Pie Charts, Bar Plots, and Histograms
| bar |
Bar graph |
| bar3 |
Plot 3-D bar graph |
| barh |
Plot bar graph horizontally |
| bar3h |
Plot horizontal 3-D bar graph |
| hist |
Histogram plot |
| histc |
Histogram count |
| area |
Filled area 2-D plot |
| pareto |
Pareto chart |
| pie |
Pie chart |
| pie3 |
3-D pie chart |
| rose |
Angle histogram plot |
Discrete Data Plots
Polar Plots
Contour Plots
Vector Fields
Surfaces, Volumes, and Polygons
Surface and Mesh Plots
| surf |
3-D shaded surface plot |
| surfc |
Contour plot under a 3-D shaded surface plot |
| surface |
Create surface object |
| surfl |
Surface plot with colormap-based lighting |
| surfnorm |
Compute and display 3-D
surface normals |
| mesh |
Mesh plot |
| meshc |
Plot a contour graph under mesh graph |
| meshz |
Plot a curtain around mesh plot |
| waterfall |
Waterfall plot |
| ribbon |
Ribbon plot |
| contour3 |
3-D contour plot |
| peaks |
Example function of two variables |
| cylinder |
Generate cylinder |
| ellipsoid |
Generate
ellipsoid |
| sphere |
Generate sphere |
| pcolor |
Pseudocolor (checkerboard) plot |
| surf2patch |
Convert surface data to patch data |
| ezsurf |
Easy-to-use 3-D colored surface plotter |
| ezsurfc |
Easy-to-use combination surface/contour plotter |
| ezmesh |
Easy-to-use 3-D mesh plotter |
| ezmeshc |
Easy-to-use combination mesh/contour plotter |
Volume Visualization
Polygons
| fill |
Filled 2-D polygons |
| fill3 |
Filled 3-D polygons |
| patch |
Create one or more filled polygons |
| surf2patch |
Convert surface data to patch data |
Animation
| movie |
Play recorded movie frames |
| noanimate |
Change EraseMode of all objects to normal |
| drawnow |
Flush event queue and update figure window |
| refreshdata |
Refresh data in graph when data source is specified |
| frame2im |
Return image data associated with movie frame |
| getframe |
Capture movie frame |
| im2frame |
Convert image to movie frame |
| comet |
2-D comet plot |
| comet3 |
3-D comet plot |
Formatting and Annotation
Titles and Labels
Coordinate System
| xlim |
Set or query x-axis limits |
| ylim |
Set or query y-axis limits |
| zlim |
Set or query z-axis limits |
| box |
Axes border |
| grid |
Grid lines for 2-D and 3-D plots |
| daspect |
Set or query axes data aspect ratio |
| pbaspect |
Set or query plot box aspect ratio |
| axes |
Create axes graphics object |
| axis |
Axis scaling and appearance |
| subplot |
Create axes in tiled positions |
| hold |
Retain current graph when adding new graphs |
| gca |
Current axes handle |
| cla |
Clear current axes |
Annotation
| annotation |
Create annotation objects |
| text |
Create text object in current axes |
| legend |
Graph legend for lines and patches |
| title |
Add title to current axes |
| xlabel |
Label x-axis |
| ylabel |
Label y-axis |
| zlabel |
Label z-axis |
| datacursormode |
Enable, disable, and manage interactive data cursor mode |
| ginput |
Graphical input from mouse or cursor |
| gtext |
Mouse placement of text in 2-D view |
Colormaps
| colormap |
Set and get current colormap |
| colormapeditor |
Open colormap editor |
| colorbar |
Colorbar showing color scale |
| brighten |
Brighten or darken colormap |
| contrast |
Grayscale colormap for contrast enhancement |
| shading |
Set color shading properties |
| graymon |
Set default figure properties for grayscale monitors |
| caxis |
Color axis scaling |
| hsv2rgb |
Convert HSV colormap to RGB colormap |
| rgb2hsv |
Convert RGB colormap to HSV colormap |
| rgbplot |
Plot colormap |
| spinmap |
Spin colormap |
| colordef |
Set default property values to display different color
schemes |
| whitebg |
Change axes background color |
Data Exploration
| hidden |
Remove hidden lines from mesh plot |
| pan |
Pan view of graph interactively |
| reset |
Reset graphics object properties to
their defaults |
| rotate |
Rotate object about specified origin and direction |
| rotate3d |
Rotate 3-D view using mouse |
| selectmoveresize |
Select, move, resize, or copy axes and uicontrol graphics
objects |
| zoom |
Turn zooming on or off or magnify
by factor |
| datacursormode |
Enable, disable, and manage interactive data cursor mode |
| figurepalette |
Show or hide Figure Palette |
| plotbrowser |
Show or hide figure Plot Browser |
| plotedit |
Interactively edit and annotate plots |
| plottools |
Show or hide plot tools |
| propertyeditor |
Show or hide Property Editor |
| showplottool |
Show or hide figure plot tool |
Data Brushing
| brush |
Interactively mark, delete, modify, and save observations
in graphs |
| datacursormode |
Enable, disable, and manage interactive data cursor mode |
| linkdata |
Automatically update graphs when variables change |
| refreshdata |
Refresh data in graph when data source is specified |
3-D Scene Control
Camera Views
| view |
Viewpoint specification |
| makehgtform |
Create 4-by-4 transform matrix |
| viewmtx |
View transformation matrices |
| cameratoolbar |
Control camera toolbar programmatically |
| campan |
Rotate camera target around camera position |
| camzoom |
Zoom in and out on scene |
| camdolly |
Move camera position and target |
| camlookat |
Position camera to view object or group of objects |
| camorbit |
Rotate camera position around camera target |
| campos |
Set or query camera position |
| camproj |
Set or query projection type |
| camroll |
Rotate camera about view axis |
| camtarget |
Set or query location of camera target |
| camup |
Set or query camera up vector |
| camva |
Set or query camera view angle |
Lighting and Transparency
| camlight |
Create or move light object in camera coordinates |
| light |
Create light object |
| lightangle |
Create or position light object in spherical coordinates |
| lighting |
Specify lighting algorithm |
| diffuse |
Calculate diffuse reflectance |
| material |
Control reflectance properties of surfaces and patches |
| specular |
Calculate specular reflectance |
| alim |
Set or query axes alpha limits |
| alpha |
Set transparency properties for objects in current axes |
| alphamap |
Specify figure alphamap (transparency) |
Images
Image File Operations
| image |
Display image object |
| imagesc |
Scale data and display image object |
| imread |
Read image from graphics file |
| imwrite |
Write image to graphics file |
| imfinfo |
Information about graphics file |
| imformats |
Manage image file format registry |
| frame2im |
Return image data associated with movie frame |
| im2frame |
Convert image to movie frame |
| im2java |
Convert image to Java image |
Modifying Images
| ind2rgb |
Convert indexed image to RGB image |
| rgb2ind |
Convert RGB image to indexed image |
| imapprox |
Approximate indexed image by reducing number of colors |
| dither |
Convert image, increasing apparent color resolution by
dithering |
| cmpermute |
Rearrange colors in colormap |
| cmunique |
Eliminate duplicate colors in colormap; convert grayscale
or truecolor image to indexed image |
Printing and Exporting
Graphics Objects
Graphics Object Identification
| gca |
Current axes handle |
| gcf |
Current figure handle |
| gcbf |
Handle of figure containing object whose callback is executing |
| gcbo |
Handle of object whose callback is executing |
| gco |
Handle of current object |
| ancestor |
Ancestor of graphics object |
| allchild |
Find all children of specified objects |
| findall |
Find all graphics objects |
| findfigs |
Find visible offscreen figures |
| findobj |
Locate graphics objects with specific properties |
| gobjects |
Create array of graphics handles |
| ishghandle |
True for Handle Graphics object handles |
| copyobj |
Copy graphics objects and their descendants |
| delete |
Remove files or graphics objects |
| get |
Query Handle Graphics object properties |
| set |
Set Handle Graphics object properties |
| propedit |
Open Property Editor |
Core Objects
| root object |
Root |
| figure |
Create figure graphics object |
| axes |
Create axes graphics object |
| image |
Display image object |
| light |
Create light object |
| line |
Create line object |
| patch |
Create one or more filled polygons |
| rectangle |
Create 2-D rectangle object |
| surface |
Create surface object |
| text |
Create text object in current axes |
Annotation Objects
Plot Objects
| set |
Set Handle Graphics object properties |
| get |
Query Handle Graphics object properties |
Group Objects
Figure Windows
| figure |
Create figure graphics object |
| gcf |
Current figure handle |
| close |
Remove specified figure |
| clf |
Clear current figure window |
| refresh |
Redraw current figure |
| newplot |
Determine where to draw graphics objects |
| shg |
Show most recent graph window |
| hgload |
Load Handle Graphics object hierarchy from file |
| hgsave |
Save Handle Graphics object hierarchy to file |
| saveas |
Save figure or Simulink block diagram using
specified format |
| closereq |
Default figure close request function |
| dragrect |
Drag rectangles with mouse |
| drawnow |
Flush event queue and update figure window |
| rbbox |
Create rubberband box for area selection |
| opengl |
Control OpenGL rendering |
Axes Property Operations
| axes |
Create axes graphics object |
| hold |
Retain current graph when adding new graphs |
| ishold |
Current hold state |
| newplot |
Determine where to draw graphics objects |
Object Property Operations
| linkaxes |
Synchronize limits of specified 2-D axes |
| linkprop |
Keep same value for corresponding properties of graphics
objects |
| refreshdata |
Refresh data in graph when data source is specified |
| waitfor |
Block execution and wait for event or condition |
| get |
Query Handle Graphics object properties |
| set |
Set Handle Graphics object properties |
Programming Scripts and Functions
Control Flow
| if/elseif/else |
Execute statements if condition is true |
| for |
Execute statements specified number of times |
| parfor |
Parallel for loop |
| switch/case/otherwise |
Switch among several cases based on expression |
| try/catch |
Execute statements and catch resulting errors |
| while |
Repeatedly execute statements while condition is true |
| break |
Terminate execution of for or while loop |
| continue |
Pass control to next iteration of for or while loop |
| end |
Terminate block of code, or indicate last array index |
| pause |
Halt execution temporarily |
| return |
Return to invoking function |
Scripts
| edit |
Edit or create file |
| input |
Request user input |
| publish |
Generate view of MATLAB file in specified format |
| notebook |
Open MATLAB Notebook in Microsoft Word software
(on Microsoft Windows platforms) |
| grabcode |
Extract MATLAB code from file published to HTML |
| snapnow |
Force snapshot of image for inclusion in published document |
Functions
Function Basics
| function |
Declare function name, inputs, and outputs |
Input and Output Arguments
Variables
| persistent |
Define persistent variable |
| genvarname |
Construct valid variable name from string |
| isvarname |
Determine whether input is valid variable name |
| namelengthmax |
Maximum identifier length |
| assignin |
Assign value to variable in specified workspace |
| global |
Declare global variables |
| isglobal |
Determine whether input is global variable |
Error Handling
| try/catch |
Execute statements and catch resulting errors |
| error |
Display message and abort function |
| warning |
Warning message |
| lastwarn |
Last warning message |
| assert |
Generate error when condition is violated |
| onCleanup |
Cleanup tasks upon function completion |
Debugging
| dbclear |
Clear breakpoints |
| dbcont |
Resume execution |
| dbdown |
Reverse workspace shift performed by dbup,
while in debug mode |
| dbquit |
Quit debug mode |
| dbstack |
Function call stack |
| dbstatus |
List all breakpoints |
| dbstep |
Execute one or more lines from current breakpoint |
| dbstop |
Set breakpoints for debugging |
| dbtype |
List text file with line numbers |
| dbup |
Shift current workspace to workspace of caller, while
in debug mode |
| checkcode |
Check MATLAB code files for possible problems |
| keyboard |
Input from keyboard |
| mlintrpt |
Run checkcode for file or folder, reporting
results in browser |
Coding and Productivity Tips
Programming Utilities
| echo |
Display statements during function execution |
| eval |
Execute MATLAB expression in text string |
| evalc |
Evaluate MATLAB expression with capture |
| evalin |
Execute MATLAB expression in specified workspace |
| feval |
Evaluate function |
| run |
Run MATLAB script |
| builtin |
Execute built-in function from overloaded method |
| depdir |
List dependent folders for function or P-file |
| depfun |
List dependencies of function or P-file |
| mfilename |
File name of currently running function |
| pcode |
Create protected function file |
| timer |
Construct timer object |
Data and File Management
Workspace Variables
| clear |
Remove items from workspace, freeing up system memory |
| clearvars |
Clear variables from memory |
| disp |
Display text or array |
| openvar |
Open workspace variable in Variables editor or other graphical
editing tool |
| who |
List variables in workspace |
| whos |
List variables in workspace, with sizes and types |
| load |
Load data from MAT-file into workspace |
| save |
Save workspace variables
to file |
| matfile |
Load and save parts of variables in MAT-files |
| workspace |
Open Workspace browser to manage workspace |
Data Import and Export
Import and Export Basics
Text Files
| csvread |
Read comma-separated value file |
| csvwrite |
Write comma-separated value file |
| dlmread |
Read ASCII-delimited file of numeric data into matrix |
| dlmwrite |
Write matrix to ASCII-delimited file |
| fileread |
Read contents of file into string |
| textread |
Read data from text file; write to multiple outputs |
| textscan |
Read formatted data from text file or string |
| type |
Display contents of file |
Spreadsheets
| xlsfinfo |
Determine whether file
contains Microsoft Excel spreadsheet |
| xlsread |
Read Microsoft Excel spreadsheet file |
| xlswrite |
Write Microsoft Excel spreadsheet file |
Low-Level File I/O
| fclose |
Close one or all open files |
| feof |
Test for end-of-file |
| ferror |
Information about file I/O errors |
| fgetl |
Read line from file, removing newline characters |
| fgets |
Read line from file, keeping newline characters |
| fopen |
Open file, or obtain information about open files |
| fprintf |
Write data to text file |
| fread |
Read data from binary file |
| frewind |
Move file position indicator to beginning of open file |
| fscanf |
Read data from text file |
| fseek |
Move to specified position in file |
| ftell |
Position in open file |
| fwrite |
Write data to binary file |
Images
| exifread |
Read EXIF information from JPEG and TIFF image files |
| im2java |
Convert image to Java image |
| imfinfo |
Information about graphics file |
| imread |
Read image from graphics file |
| imwrite |
Write image to graphics file |
| Tiff |
MATLAB Gateway to LibTIFF library routines |
Scientific Data
netCDF Files
| nccreate |
Create variable in NetCDF
file |
| ncdisp |
Display contents of
NetCDF data source in Command Window |
| ncinfo |
Return information about
NetCDF data source |
| ncread |
Read data from variable
in NetCDF data source |
| ncreadatt |
Read attribute value
from NetCDF data source |
| ncwrite |
Write data to NetCDF
file |
| ncwriteatt |
Write attribute to NetCDF file |
| ncwriteschema |
Add NetCDF schema definitions to NetCDF file |
| netcdf |
Summary of MATLAB Network Common Data Form (NetCDF)
capabilities |
HDF5 Files
High-Level Functions
Low-Level Functions
Library (H5)
Attribute (H5A)
Dataset (H5D)
Dimension Scale (H5DS)
Error (H5E)
File (H5F)
Group (H5G)
Identifier (H5I)
Link (H5L)
MATLAB (H5ML)
Object (H5O)
Property (H5P)
General Property List Operations
Generic Property List Operations
Dataset Access, Memory, and Transfer Properties
Dataset Creation Properties
File Access Properties
File Creation Properties
Object Copy and Object Creation Properties
Group Creation Properties
String Properties
Reference (H5R)
Dataspace (H5S)
Datatype (H5T)
General Data Type Operation
Array Data Type
Atomic Data Type Properties
Compound Data Type
Enumeration Data Type
Opaque Data Type Properties
Variable-length Data Type
Filters and Compression (H5Z)
HDF4 Files
| hdfinfo |
Information about HDF4 or HDF-EOS file |
| hdfread |
Read data from HDF4 or HDF-EOS file |
| hdf |
Summary of MATLAB HDF4 capabilities |
FITS Files
Band-Interleaved Files
Common Data Format
| cdfepoch |
Convert MATLAB formatted dates to CDF formatted dates |
| cdfinfo |
Information about Common Data Format (CDF) file |
| cdfread |
Read data from Common Data Format (CDF) file |
| cdfwrite |
Write data to Common Data Format (CDF) file |
| todatenum |
Convert CDF epoch object to MATLAB datenum |
| cdflib |
Summary of Common Data Format (CDF) capabilities |
Audio and Video
Reading and Writing Files
Recording and Playback
Utilities
| beep |
Produce beep sound |
| lin2mu |
Convert linear audio signal to mu-law |
| mu2lin |
Convert mu-law audio signal to linear |
XML Documents
| xmlread |
Read XML document and return Document Object Model node |
| xmlwrite |
Write XML Document Object
Model node |
| xslt |
Transform XML document using XSLT engine |
Memory Mapping
File Operations
Files and Folders
| dir |
List folder contents |
| ls |
List folder contents |
| pwd |
Identify current folder |
| fileattrib |
Set or get attributes of file or folder |
| exist |
Check existence of variable, function, folder, or class |
| isdir |
Determine whether input is folder |
| type |
Display contents of file |
| visdiff |
Compare two text files, MAT-Files, binary files, Zip files, or folders |
| what |
List MATLAB files in folder |
| which |
Locate functions and files |
| cd |
Change current folder |
| copyfile |
Copy file or folder |
| delete |
Remove files or graphics objects |
| recycle |
Set option to move deleted files to recycle folder |
| mkdir |
Make new folder |
| movefile |
Move file or folder |
| rmdir |
Remove folder |
| open |
Open file in appropriate application |
| winopen |
Open file in appropriate application (Windows) |
| filebrowser |
Open Current Folder browser, or select it if already open |
File Name Construction
File Compression
| gunzip |
Uncompress GNU zip files |
| gzip |
Compress files into GNU zip files |
| tar |
Compress files into tar file |
| untar |
Extract contents of tar file |
| unzip |
Extract contents of zip file |
| zip |
Compress files into zip file |
Search Path
| addpath |
Add folders to search path |
| rmpath |
Remove folders from search path |
| path |
View or change search path |
| savepath |
Save current search path |
| userpath |
View or change user portion of search path |
| genpath |
Generate path string |
| pathsep |
Search path separator for current platform |
| pathtool |
Open Set Path dialog box to view and change search path |
| restoredefaultpath |
Restore default search path |
Operating System Commands
| clipboard |
Copy and paste strings to and from system clipboard |
| computer |
Information about computer on which MATLAB software
is running |
| dos |
Execute DOS command and return output |
| getenv |
Environment variable |
| perl |
Call Perl script using appropriate operating system executable |
| setenv |
Set environment variable |
| system |
Execute operating system command and return output |
| unix |
Execute UNIX command and return output |
| winqueryreg |
Item from Windows registry |
Internet File Access
| ftp |
Connect to FTP server |
| sendmail |
Send email message to address list |
| urlread |
Download URL content to MATLAB string |
| urlwrite |
Download URL content and save to file |
| web |
Open Web page or file in browser |
Serial Port Devices
GUI Building
Component Selection
GUI Controls and Indicators
| figure |
Create figure graphics object |
| axes |
Create axes graphics object |
| uicontrol |
Create user interface control object |
| uitable |
Create 2-D graphic table GUI component |
| uipanel |
Create panel container object |
| uibuttongroup |
Create container object to exclusively manage radio buttons
and toggle buttons |
| actxcontrol |
Create Microsoft ActiveX control in figure window |
Menus and Toolbars
Predefined Dialog Boxes
| dialog |
Create and display empty dialog box |
| errordlg |
Create and open error dialog box |
| helpdlg |
Create and open help dialog box |
| msgbox |
Create and open message box |
| questdlg |
Create and open question dialog box |
| uigetpref |
Specify and conditionally
open dialog box according to user preference |
| uisetpref |
Manage preferences used in uigetpref |
| waitbar |
Open or update wait bar dialog box |
| warndlg |
Open warning dialog box |
| export2wsdlg |
Export variables to workspace |
| inputdlg |
Create and open input dialog box |
| listdlg |
Create and open list-selection dialog box |
| uisetcolor |
Open standard dialog box for setting object's ColorSpec |
| uisetfont |
Open standard dialog box for setting object's font characteristics |
| printdlg |
Print dialog box |
| printpreview |
Preview figure to print |
| uigetdir |
Open standard dialog box for selecting directory |
| uigetfile |
Open standard dialog box for retrieving files |
| uiopen |
Interactively select file to open and load data |
| uiputfile |
Open standard dialog box for saving files |
| uisave |
Interactively save workspace variables to MAT-file |
Component Layout
| align |
Align user interface controls (uicontrols)
and axes |
| movegui |
Move GUI figure to specified location on screen |
| getpixelposition |
Get component position in pixels |
| setpixelposition |
Set component position in pixels |
| listfonts |
List available system fonts |
| textwrap |
Wrapped string matrix for given uicontrol |
| uistack |
Reorder visual stacking order of objects |
Coding GUI Behavior
Packaging GUIs as Apps
Advanced Software Development
Object-Oriented Programming
Class Syntax Fundamentals
Defining MATLAB Classes
Class Definition and Organization
| classdef |
Class definition keywords |
| import |
Add package or class to current import list |
Properties
| properties |
Class property names |
| isprop |
Determine if property of object |
| dynamicprops |
Abstract class used to derive handle class with dynamic
properties |
| meta.property |
meta.property class describes MATLAB class
properties |
Methods
Handle Classes
| handle |
Abstract class for deriving handle classes |
| hgsetget |
Abstract class used to derive handle class with set and
get methods |
| dynamicprops |
Abstract class used to derive handle class with dynamic
properties |
| matlab.mixin.Copyable |
Superclass providing copy functionality for handle objects |
| delete |
Handle object destructor |
| findobj |
Find handle objects matching specified conditions |
| isa |
Determine if input is object of specified class |
| isvalid |
Is object valid handle class object |
| findprop |
Find meta.property object associated
with property name |
| relationaloperators |
Equality and sorting of handle objects |
Events
Object Arrays
Class Hierarchies
Enumerations
Control Save and Load
| save |
Save workspace variables
to file |
| load |
Load data from MAT-file into workspace |
| saveobj |
Modify save process for object |
| loadobj |
Modify load process for object |
Customize MATLAB Behavior
| cat |
Concatenate arrays along specified dimension |
| horzcat |
Concatenate arrays horizontally |
| vertcat |
Concatenate arrays vertically |
| empty |
Create empty array |
| disp |
Display text or array |
| display |
Display text and numeric expressions |
| numel |
Number of array elements |
| size |
Array dimensions |
| end |
Terminate block of code, or indicate last array index |
| subsref |
Redefine subscripted reference for objects |
| subsasgn |
Subscripted assignment |
| subsindex |
Subscript indexing with object |
| substruct |
Create structure argument for subsasgn or subsref |
Getting Information About Classes and Objects
Exception Handling
Performance and Memory
Code Performance
| bench |
MATLAB benchmark |
| cputime |
Elapsed CPU time |
| memory |
Display memory information |
| profile |
Profile execution time for function |
| profsave |
Save profile report in HTML format |
| tic |
Start clock to measure
performance |
| toc |
Stop clock to measure
performance |
Memory Usage
| clear |
Remove items from workspace, freeing up system memory |
| inmem |
Names of functions, MEX-files, classes in memory |
| memory |
Display memory information |
| pack |
Consolidate workspace memory |
| whos |
List variables in workspace, with sizes and types |
Unit Testing Framework
Write Unit Tests
Run Unit Tests
Analyze Test Results
Custom Documentation
External Programming Language Interfaces
Java Libraries
| javaArray |
Construct Java array object |
| javaclasspath |
Return Java class path or specify dynamic path |
| javaaddpath |
Add entries to dynamic Java class path |
| javarmpath |
Remove entries from dynamic Java class path |
| javachk |
Error message based on Java feature support |
| isjava |
Determine if input is Java object |
| usejava |
Determine if Java feature is supported in MATLAB |
| javaMethod |
Call Java method |
| javaMethodEDT |
Call Java method from Event Dispatch Thread (EDT) |
| javaObject |
Call Java constructor |
| javaObjectEDT |
Call Java constructor on Event Dispatch Thread (EDT) |
| cell |
Create cell array |
| class |
Determine class of object |
| clear |
Remove items from workspace, freeing up system memory |
| depfun |
List dependencies of function or P-file |
| exist |
Check existence of variable, function, folder, or class |
| fieldnames |
Field names of structure, or public fields of object |
| im2java |
Convert image to Java image |
| import |
Add package or class to current import list |
| inmem |
Names of functions, MEX-files, classes in memory |
| inspect |
Open Property Inspector |
| isa |
Determine if input is object of specified class |
| methods |
Class method names |
| methodsview |
View class methods |
| which |
Locate functions and files |
| matlab.exception.JavaException |
Capture error information for Java exception |
.NET Libraries
Getting Started
Data Types
| NET.createArray |
Array for nonprimitive .NET types |
| cell |
Create cell array |
| NET.disableAutoRelease |
Lock .NET object representing a RunTime Callable Wrapper
(COM Wrapper) so that MATLAB does not release COM object |
| NET.enableAutoRelease |
Unlock .NET object representing a RunTime Callable Wrapper
(COM Wrapper) so that MATLAB releases COM object |
Properties
Events and Delegates
| BeginInvoke |
Initiate asynchronous .NET delegate call |
| EndInvoke |
Retrieve result of asynchronous call initiated by .NET
System.Delegate BeginInvoke method |
| Combine |
Convenience function for static .NET System.Delegate Combine
method |
| Remove |
Convenience function for static .NET System.Delegate Remove
method |
| RemoveAll |
Convenience function for static .NET System.Delegate RemoveAll
method |
Enumerations
Generic Classes
COM Interface
COM Objects
| actxserver |
Create COM server |
| actxcontrol |
Create Microsoft ActiveX control in figure window |
| actxcontrollist |
List currently installed Microsoft ActiveX controls |
| actxcontrolselect |
Create Microsoft ActiveX control from GUI |
| iscom |
Determine whether input is COM or ActiveX object |
| isprop |
Determine whether input is COM object property |
| get |
Get property
value from interface, or display properties |
| set |
Set object
or interface property to specified value |
| addproperty |
Add custom property to COM object |
| deleteproperty |
Remove custom property from COM object |
| inspect |
Open Property Inspector |
| propedit |
Open built-in property page for control |
| fieldnames |
Field names of structure, or public fields of object |
| ismethod |
Determine whether input is COM object method |
| methods |
Class method names |
| methodsview |
View class methods |
| invoke |
Invoke method on COM object or interface, or display methods |
| isevent |
Determine whether input is COM object event |
| events |
List of events COM object can trigger |
| eventlisteners |
List event handler functions associated with COM object
events |
| registerevent |
Associate event handler for COM object event at run time |
| unregisterallevents |
Unregister all event handlers associated with COM object
events at run time |
| unregisterevent |
Unregister event handler associated with COM object event
at run time |
| isinterface |
Determine whether input is COM interface |
| interfaces |
List custom interfaces exposed by COM server object |
| release |
Release COM interface |
| delete |
Remove COM control or server |
| move |
Move or resize control in parent window |
| load |
Initialize control object from file |
| save |
Serialize control object to file |
Call MATLAB COM Automation Server
Web Services
C Shared Libraries
| loadlibrary |
Load shared library into MATLAB |
| calllib |
Call function in shared library |
| libfunctions |
Return information on functions in shared library |
| libfunctionsview |
Display shared library function signatures in window |
| libisloaded |
Determine if shared library is loaded |
| unloadlibrary |
Unload shared library from memory |
| libstruct |
Convert MATLAB structure to C-style structure for use
with shared library |
| libpointer |
Pointer object for use with shared library |
Application Programming Interfaces to MATLAB
Create MEX-Files
Call MEX-Files
| mexext |
Binary MEX-file name extension |
| inmem |
Names of functions, MEX-files, classes in memory |
Build C/C++ MEX-Files
| mex |
Compile MEX-function from C/C++ or Fortran source code |
| dbmex |
Enable MEX-file debugging (on UNIX platforms) |
| mex.getCompilerConfigurations |
Get compiler configuration information for building MEX-files |
Build Fortran MEX-Files
| mex |
Compile MEX-function from C/C++ or Fortran source code |
| dbmex |
Enable MEX-file debugging (on UNIX platforms) |
| mex.getCompilerConfigurations |
Get compiler configuration information for building MEX-files |
Troubleshoot MEX-Files
| dbmex |
Enable MEX-file debugging (on UNIX platforms) |
| inmem |
Names of functions, MEX-files, classes in memory |
| mex |
Compile MEX-function from C/C++ or Fortran source code |
| mex.getCompilerConfigurations |
Get compiler configuration information for building MEX-files |
| mexext |
Binary MEX-file name extension |
Source Control Integration
| checkin |
Check files into source control system (UNIX platforms) |
| checkout |
Check files out of source control system (UNIX platforms) |
| cmopts |
Name of source control system |
| customverctrl |
Allow custom source control system (UNIX platforms) |
| undocheckout |
Undo previous checkout from source control system (UNIX platforms) |
| verctrl |
Source control actions (Windows platforms) |
Desktop Environment
Startup and Shutdown
| matlab (Windows) |
Start MATLAB program (Windows platforms) |
| matlab (UNIX) |
Start MATLAB program (UNIX platforms) |
| exit |
Terminate MATLAB program (same as quit) |
| quit |
Terminate MATLAB program |
| matlabrc |
Startup file for MATLAB program |
| startup |
Startup file for user-defined options |
| finish |
Termination file for MATLAB program |
Basic Settings
| prefdir |
Folder containing preferences, history, and layout files |
| preferences |
Open Preferences dialog box |
Platform and License
| ismac |
Determine if version is for Mac OS X platform |
| ispc |
Determine if version is for Windows (PC) platform |
| isstudent |
Determine if version is Student Version |
| isunix |
Determine if version is for UNIX platform |
| javachk |
Error message based on Java feature support |
| license |
Return license number or perform licensing task |
| usejava |
Determine if Java feature is supported in MATLAB |
| ver |
Version information for MathWorks products |
| verLessThan |
Compare toolbox version to specified version string |
| version |
Version number for MATLAB and libraries |
Help and Support
| doc |
Reference page in Help browser |
| help |
Help for functions in Command Window |
| docsearch |
Help browser search |
| lookfor |
Search for keyword in all help entries |
| demo |
Access product examples in Help browser |
| echodemo |
Run example script step-by-step in Command Window |
Was this topic helpful?