matrixFromRows

matrixFromRows(...arr)

matrixFromRows(row1, row2)

matrixFromRows(row1, row2, row3)

Try it yourself:

See also:

Build a matrix from rows

matrixFromRows constructs a matrix by treating each supplied vector or array as one row. It is ideal when observations, equations, or records are already written horizontally.

Example

Rows [1,2] and [3,4] form a 2-by-2 matrix. Use matrixFromColumns when your inputs are features stored as columns. transpose exchanges the two viewpoints.

Compatibility

All rows must have the same length for a rectangular matrix. Verify dimensions with size before using multiply or a solver. concat can append compatible row blocks, but matrixFromRows is clearer at construction time.

All functions