MatrixMxN.fromArray and MatrixMxN.takeByPattern