human
Write a function to sort a given matrix in ascending order according to the sum of its rows. Here is a solution in Python:
assistant
#Here is the Python program you requested.
 def sort_matrix(M):
    result = sorted(M, key=sum)
    return result