Problem

Develop, debug, and test your own M-file function to switch the rows of a matrix using a p...

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).

Step-by-Step Solution

Request Professional Solution

Request Solution!

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.

Request! (Login Required)


All students who have requested the solution will be notified once they are available.
Add your Solution
Textbook Solutions and Answers Search
Solutions For Problems in Chapter 8