Added a method to convert the matrix object to an array (a counterpart of Matrix.fill().)