Returns the smallest item in a matrix.
Every cell is considered, so [[4, -3], [8, 0]] gives -3. A matrix with only na items gives na.
For one row or column, pull it out as an array first and call array.min().
Syntax
matrix.min(id: matrix<int/float>) -> series float
matrix.min(id: matrix<int>) -> series int
matrix.min() -> series float
matrix.min() -> series intArguments
| Name | Type | Default | Description |
|---|---|---|---|
| id | matrix<int/ | required | The matrix searched in full for its smallest item, across every row and column. |
Returns
series float: The smallest item as a float.series int: The smallest item as a whole number, to match an integer matrix.series float: The smallest item of the receiving matrix as a float.series int: The smallest item of the receiving matrix as a whole number.
Example
//@version=6
indicator("matrix.min: trough", overlay = false)
matrix<float> m = matrix.new<float>(2, 2, 4.0)
matrix.set(m, 0, 1, -2.0)
plot(matrix.min(m), "Smallest")See also
Runs on Sidechair