The row number and column number of matrix are assigned as input arguments. The matrix is then generated randomly.