In [1]:
require 'nmatrix'
NMatrix.new([2, 3], [0, 1, 2, 3, 4, 5], dtype: :int64)


Out[1]:
$$\left(\begin{array}{ccc} 0&1&2\\ 3&4&5\\ \end{array}\right)$$

In [ ]: