Define a function mat_rot that takes a matrix and rotates it by 180 degrees.

1. Use list comprehensions to create a 10 by 10 matrix m_7 containing the numbers 1-100, such that m_7[i][j+1] = m_7[i][j] + 1 and m_7[i+1][j] = m_7[i][j] + 10.
2. Define a function mat_rot that takes a matrix and rotates it by 180 degrees.
3. Define functions mat_row_split and mat_col_split that takes a matrix and returns the rows or columns, respectively.
4. Define a function even_odd_split that takes a matrix and returns two matrices, one containing only even numbers, and another containing only odd numbers (and zeros when necessary) whose sum is the input matrix.
5. Define functions mat_max and mat_min which return the maximum and minum entry of an input matrix, respectively.

Leave a comment

Your email address will not be published. Required fields are marked *