matrix.get() - Pine Script Function
matrix.get()
Section titled “matrix.get()”Overview
Section titled “Overview”The function returns the element with the specified index of the matrix.
Syntax
Section titled “Syntax”matrix.get(id, row, column) → <matrix_type>Parameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
| id | any matrix type | A matrix object. |
Returns
Section titled “Returns”The value of the element at the row and column index of the id matrix.
Remarks
Section titled “Remarks”- Indexing of the rows and columns starts at zero.
Examples
Section titled “Examples”Example 1
Section titled “Example 1”//@version=6indicator("`matrix.get()` Example", "", true)// Create a 2x3 "float" matrix from the `hl2` values.m = matrix.new<float>(2, 3, hl2)// Return the value of the element at index [0, 0]of matrix `m`.x = matrix.get(m, 0, 0)plot(x)