matrix.rows() - Pine Script Function
matrix.rows()
Section titled “matrix.rows()”Overview
Section titled “Overview”The function returns the number of rows in the matrix.
Syntax
Section titled “Syntax”matrix.rows(id) → series intParameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
| id | any matrix type | A matrix object. |
Returns
Section titled “Returns”The number of rows in the matrix id.
Examples
Section titled “Examples”Example 1
Section titled “Example 1”//@version=6indicator("`matrix.rows()` Example")// Create a 2x6 matrix with values `0`.var m = matrix.new<int>(2, 6, 0)// Get the quantity of rows in the matrix.var x = matrix.rows(m)// Display using a label.if barstate.islastconfirmedhistorylabel.new(bar_index, high, "Rows: " + str.tostring(x) + "\n" + str.tostring(m))