Appends the rows of a second matrix below the first and returns the first matrix.
Both matrices need the same number of columns. After the call the first matrix is taller by the number of rows of the second, which is not changed.
The returned value is the first matrix itself, so it can be assigned or ignored.
Syntax
matrix.concat(id1: any matrix type, id2: any matrix type) -> matrix<>
matrix.concat(id2: any matrix type) -> matrix<>Arguments
| Name | Type | Default | Description |
|---|---|---|---|
| id1 | any matrix type | required | The matrix that gets the rows of the second matrix added below its own. |
| id2 | any matrix type | required | The matrix whose rows are added below the first. |
Returns
matrix<>: The first matrix, now including the rows of the second.
Example
//@version=6
indicator("matrix.concat: stack", overlay = false)
matrix<float> top = matrix.new<float>(2, 3, 1.0)
matrix<float> bottom = matrix.new<float>(1, 3, 2.0)
matrix.concat(top, bottom)
plot(matrix.rows(top), "Rows after stacking")See also
Runs on Sidechair