Methods
(static) bitset(value, position, bit) → {Array.<Array.<number>>}
Set bit at specific location
Name | Type | Description |
---|---|---|
value | Array.<number> | Input value, specified as an scalar. |
position | number | Bit position, specified as an integer. |
bit | 0 | | Bit value, specified as a integer. |
'value' with 'position' bit set to the value of 'bit'.
- Type:
- Array.<Array.<number>>
(static) det(array) → {number}
Matrix determinant
Name | Type | Description |
---|---|---|
array | Array.<Array.<number>> | Input matrix, specified as a square numeric matrix. |
the determinant of square matrix.
- Type:
- number
(static) diag(values) → {Array.<Array.<number>>}
Create diagonal matrix or get diagonal elements of matrix
Name | Type | Description |
---|---|---|
values | Array.<Array.<number>> | Diagonal elements, specified as a vector. |
a square diagonal matrix with the elements of vector v on the main diagonal.
- Type:
- Array.<Array.<number>>
(static) find(array) → {Array.<number>}
Find indices and values of nonzero elements
Name | Type | Description |
---|---|---|
array | Array.<any> | Input array, specified as a scalar, vector, matrix, or multidimensional array. |
a vector containing the linear indices of each nonzero element in array X.
- Type:
- Array.<number>
(static) flip(array, n) → {Array.<any>}
Flip order of elements CAUTION: This function modifies the original array.
Name | Type | Description |
---|---|---|
array | Array.<any> | Input array, specified as a vector, matrix, or multidimensional array. |
n | number | Dimension to operate along, specified as a positive integer scalar. |
array with the same size as input, but with the order of the elements at n-th dimension reversed.
- Type:
- Array.<any>
(static) inv(matrix) → {Array.<Array.<number>>}
Matrix inverse
Name | Type | Description |
---|---|---|
matrix | Array.<Array.<number>> | Input matrix, specified as a square matrix. |
inverse of input matrix.
- Type:
- Array.<Array.<number>>
(static) isequal(array1, array2) → {boolean}
Determine array equality
Name | Type | Description |
---|---|---|
array1 | Array.<any> | Input to be compared |
array2 | Array.<any> | Input to be compared |
true if array1 and array2 are equivalent; otherwise, it returns false.
- Type:
- boolean
(static) isnumeric(value) → {boolean}
Determine whether input is numeric array
Name | Type | Description |
---|---|---|
value | any | | Input array or value |
true if A is an array of numeric data type. Otherwise, it returns false.
- Type:
- boolean
(static) ndims(array) → {Array.<number>}
Number of array dimensions
Name | Type | Description |
---|---|---|
array | Array.<any> | Input array, specified as a scalar, a vector, a matrix, or a multidimensional array. |
the number of dimensions in the input array. The number of dimensions is always greater than or equal to 2.
- Type:
- Array.<number>
(static) permute(array, order) → {Array.<any>}
Permute array dimentions
Name | Type | Description |
---|---|---|
array | Array.<any> | Input array, specified as a vector, matrix, or multidimensional array. |
order | Array.<number> | Dimension order, specified as a row vector with unique, positive integer elements that represent the dimensions of the input array. |
Input array with the dimensions rearranged in the order specified by the vector dimorder. For example, permute(A,[1,0]) switches the row and column dimensions of a matrix A. In general, the ith dimension of the output array is the dimension dimorder(i) from the input array.
- Type:
- Array.<any>
(static) prod(array) → {number}
Product of array elements
Name | Type | Description |
---|---|---|
array | Array.<number> | Input array, specified as a one dimensional array. |
product of the array elements of input.
- Type:
- number
(static) reshape(array, sizes) → {Array.<Object>}
Reshape array by rearranging existing elements
Name | Type | Description |
---|---|---|
array | Array.<any> | Input array, specified as a vector, matrix, or multidimensional array. |
sizes | Array.<number> | Output size, specified as a row vector of integers. Each element of sizes indicates the size of the corresponding dimension in output. You must specify the size so that the number of elements in input array and output array are the same. That is, prod(sizes) must be the same as number_of_elements(input). |
If number of elements changes after changing the transition.
- Type
- Error
Reshaped array, returned as a vector, matrix, multidimensional array. The data type and number of elements in output are the same as the data type and number of elements in input.
- Type:
- Array.<Object>
(static) size(array) → {Array.<number>}
Array size
Name | Type | Description |
---|---|---|
array | Array.<any> | Input array, specified as a scalar, a vector, a matrix, or a multidimensional array. |
a row vector whose elements are the lengths of the corresponding dimensions of input.
- Type:
- Array.<number>
(static) sub2ind(sizes, …subs) → {number}
Convert subscripts to linear indices
Name | Type | Attributes | Description |
---|---|---|---|
sizes | Array.<number> | Size of array, specified as a vector of positive integers. Each element of this vector indicates the size of the corresponding dimension. | |
subs | number | <repeatable> | Multidimensional subscripts, specified in scalars. |
If number of subscripts does not match number of dimensions or subscript is out of bounds.
- Type
- Error
Linear index, returned as a scalar
- Type:
- number
(static) transpose(arr) → {Array.<Array.<any>>}
Transpose vector or matrix
Name | Type | Description |
---|---|---|
arr | Array.<Array.<any>> | Input array, specified as a vector or matrix. |
the nonconjugate transpose of input array, that is, interchanges the row and column index for each element.
- Type:
- Array.<Array.<any>>
(static) unique(array) → {Array.<any>}
Given an array, return an array that does not contain any duplicates Only tested with single dimensional array
Name | Type | Description |
---|---|---|
array | Array.<any> | Input array |
Array with the same data as in A, but with no repetitions.
- Type:
- Array.<any>