Skip to content
Algo Trade Analytics Docs

matrix.row() - Pine Script Function

The function creates a one-dimensional array from the elements of a matrix row.

matrix.row(id, row) → array<type>
NameTypeDescription
idany matrix typeA matrix object.

An array ID containing the row values of the id matrix.

  • Indexing of rows starts at 0.
//@version=6
indicator("`matrix.row()` Example", "", true)// Create a 2x3 "float" matrix from `hlc3` values.m = matrix.new<float>(2, 3, hlc3)// Return an array with the values of the first row of the matrix.a = matrix.row(m, 0)// Plot the first value from the array `a`.
plot(array.get(a, 0))