input: Write a python function to generate a matrix with random integers and return it as a string.
  assert len(generate_matrix(3, 5).split('\n')) == 4
  assert all(len(row.split()) == 5 for row in generate_matrix(3, 5).split('\n')[:-1])
  assert generate_matrix(2, 3).count('\n') == 2
output: import random
  
  def generate_matrix(rows, cols):
      matrix = ""
      for _ in range(rows):
          matrix += ' '.join(str(random.randint(0, 100)) for _ in range(cols)) + '\n'
      return matrix