Converts an array to a matrix.
The array
The number of rows of the matrix
Optional
The number of columns of the matrix (optional, defaults to the number of rows to make a square matrix)
const result = Chalkboard.stat.toMatrix([1, 2, 3, 4], 2); // Returns [[1, 2], [3, 4]] Copy
const result = Chalkboard.stat.toMatrix([1, 2, 3, 4], 2); // Returns [[1, 2], [3, 4]]
Converts an array to a matrix.