reshape#
Reshape a multi dimensional array to fit the specified dimensions.
Available in: math cells, REPL.
Syntax#
reshape(x, sizes)
Arguments and behavior#
For matrices, dimensions must match the operation. Singular matrices or incompatible shapes can fail. Cell indexing starts at 1. The example returns matrix.
Example#
Edit the inputs, then use Run or Reset. Changes stay in this example.
Example
reshape([1, 2, 3, 4, 5, 6], [2, 3])Interactive examples could not load. You can still copy the expressions.
Expected result: matrix.