MATLAB Function Reference Previous page   Next Page

Arrays and Matrices

Basic Information

disp Display text or array
display Overloaded method to display text or array
isempty Determine if input is empty matrix
isequal Test arrays for equality
isequalwithequalnans Test arrays for equality, treating NaNs as equal
isfloat Determine if input is floating-point array
isinteger Determine if input is integer array
islogical Determine if input is logical array
isnumeric Determine if input is numeric array
isscalar Determine if input is scalar
issparse Determine if input is sparse matrix
isvector Determine if input is vector
length Length of vector
ndims Number of dimensions
numel Number of elements
size Size of matrix

Operators

+ 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)

Operations and Manipulation

: (colon) Create vectors, array subscripting, and for loop iterations
accumarray Construct an array with accumulation
blkdiag Block diagonal concatenation
cast Cast variable to different data type
cat Concatenate arrays along specified dimension
cross Vector cross product
cumprod Cumulative product
cumsum Cumulative sum
diag Diagonal matrices and diagonals of matrix
dot Vector dot product
end Indicate last index of array
find Find indices of nonzero elements
fliplr Flip matrices left-right
flipud Flip matrices up-down
flipdim Flip matrix along specified dimension
horzcat Concatenate arrays horizontally
ind2sub Multiple subscripts from linear index
ipermute Inverse permute dimensions of multidimensional array
kron Kronecker tensor product
max Maximum value of array
min Minimum value of array
permute Rearrange dimensions of multidimensional array
prod Product of array elements
repmat Replicate and tile array
reshape Reshape array
rot90 Rotate matrix 90 degrees
sort Sort array elements in ascending or descending order
sortrows Sort rows in ascending order
sum Sum of array elements
sqrtm Matrix square root
sub2ind Linear index from multiple subscripts
tril Lower triangular part of matrix
triu Upper triangular part of matrix
vertcat Concatenate arrays vertically

See also Linear Algebra for other matrix operations.

See also Elementary Math for other array operations.

Elementary Matrices and Arrays

: (colon) Create vectors, array subscripting, and for loop iterations
blkdiag Construct block diagonal matrix from input arguments
diag Diagonal matrices and diagonals of matrix
eye Identity matrix
freqspace Frequency spacing for frequency response
linspace Generate linearly spaced vectors
logspace Generate logarithmically spaced vectors
meshgrid Generate X and Y matrices for three-dimensional plots
ndgrid Arrays for multidimensional functions and interpolation
ones Create array of all ones
rand Uniformly distributed random numbers and arrays
randn Normally distributed random numbers and arrays
repmat Replicate and tile array
zeros Create array of all zeros

Specialized Matrices

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

Previous page  Mathematics Linear Algebra Next page

© 1994-2005 The MathWorks, Inc.