numel – Number of elements in array or subscripted array expression
n = numel(A) n = numel(A, index1, index2, ... indexn)
n = numel(A) returns the number of elements, n, in array A.
n = numel(A, index1, index2, … indexn) returns the number of subscripted elements, n, in A(index1, index2, …, indexn). To handle the variable number of arguments, numel is typically written with the header function n = numel(A, varargin), where varargin is a cell array with elements index1, index2, … indexn.
not – Logical NOT ~
cat – Concatenate arrays along specified dimension
C = cat(dim, A, B) C = cat(dim, A1, A2, A3, A4, ...)
C = cat(dim, A, B)concatenates the arrays A and B along array dimension dim.
C = cat(dim, A1, A2, A3, A4, …)concatenates all the input arrays (A1, A2, A3, A4, and so on) along array dimension dim.
For nonempty arrays, cat(2, A, B) is the same as [A, B], and cat(1, A, B) is the same as [A; B]
rand – Uniformly distributed pseudorandom numbers
r = rand(n) r = rand(m,n) r = rand([m,n]) r = rand(m,n,p,...) r = rand([m,n,p,...]) r = rand r = rand(size(A)) r = rand(..., 'double') r = rand(..., 'single')
r = rand(n) returns an n-by-n matrix containing pseudorandom values drawn from the standard uniform distribution on the open interval (0,1).
r = rand(m,n) or r = rand([m,n]) returns an m-by-n matrix.
ind = find(X) locates all nonzero elements of array X, and returns the linear indices of those elements in vector ind. If X is a row vector, then ind is a row vector; otherwise, ind is a column vector. If X contains no nonzero elements or is an empty array, then ind is an empty array.
prod – Product of array elements
B = prod(A) B = prod(A,dim) B = prod(A,'double') B = prod(A,'native')
B = prod(A) returns the products along different dimensions of an array. A can be double or single. B is multiplied natively, that is in the same class as A, and B has the same class as A.
If A is a vector, prod(A) returns the product of the elements.
If A is a matrix, prod(A) treats the columns of A as vectors, returning a row vector of the products of each column.
If A is a multidimensional array, prod(A) treats the values along the first non-singleton dimension as vectors, returning an array of row vectors.
B = prod(A,dim) takes the products along the dimension of A specified by scalar dim.
B = prod(A,’double’) multiplies B in double and B has class double, even if A is single.
B = prod(A,’native’) multiplies B natively and B has the same class as A.
bsxfun – Apply element-by-element binary operation to two arrays with singleton expansion enabled
C = bsxfun(fun,A,B)
C = bsxfun(fun,A,B) applies an element-by-element binary operation to arrays A and B, with singleton expansion enabled. The inputs must be of the following types: numeric, logical, char, struct, cell.fun is a function handle, and can either be an MATLAB-function or one of the following built-in functions:
- @plus Plus
- @minus Minus
- @times Array multiply