input: Write a function that takes two matrices as input and returns their sum if they are compatible, otherwise returns an error message. The function should first check if the two matrices have the same dimensions. If they do, it should sum the corresponding elements of the matrices and return the resulting matrix. If they do not have the same dimensions, it should return an error message indicating that the matrices are not compatible for addition.
  
  assert add_matrix([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]
  assert add_matrix([[1, 2]], [[5, 6]]) == [[6, 8]]
  assert add_matrix([[1], [2]], [[3], [4]]) == [[4], [6]]
  assert add_matrix([[1, 2], [3, 4]], [[5, 6]]) == 'Matrices not compatible'
  assert add_matrix([[1, 2]], [[5], [6]]) == 'Matrices not compatible'
output: def add_matrix(matrix1, matrix2):
      if len(matrix1) != len(matrix2) or len(matrix1[0]) != len(matrix2[0]):
          return 'Matrices not compatible'
      result = []
      for i in range(len(matrix1)):
          row = []
          for j in range(len(matrix1[0])):
              row.append(matrix1[i][j] + matrix2[i][j])
          result.append(row)
      return result