Develop, debug, and test your own M-file function to switch the rows of a matrix using a permutation matrix. The first lines of the function should be as follows:
function B = permut(A, r1, r2) %% Permut: Switch rows of matrix A% with a permutation matrix% B = permut(A,r1,r2) %% input:% A = original matrix% r1, r2 = rows to be switched% output:% B = matrix with rows switched
Include error traps for erroneous inputs (e.g., user specifies rows that exceed the dimensions of the original matrix).
We need at least 10 more requests to produce the solution.
0 / 10 have requested this problem solution
The more requests, the faster the answer.