singleton method Matrix.vstack

vstack(*matrices) -> Matrix[permalink][rdoc][edit]

行列 matrices を縦に並べた行列を生成します。



require 'matrix'
x = Matrix[[1, 2], [3, 4]]
y = Matrix[[5, 6], [7, 8]]
Matrix.vstack(x, y) # => Matrix[[1, 2], [3, 4], [5, 6], [7, 8]]
[PARAM] matrices:
並べる行列。すべての行列の列数が一致していなければならない
[EXCEPTION] ExceptionForMatrix::ErrDimensionMismatch:
列数の異なる行列がある場合に発生します

[SEE_ALSO] Matrix.hstack, Matrix#vstack