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

Question:

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) SS% permut Switch rows of matrix A% with a permutation matrix% B = permut( A,rl,r2) SS% 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)?
Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  book-img-for-question

Numerical Methods For Engineers

ISBN: 9780071244299

5th Edition

Authors: Steven C. Chapra, Raymond P. Canale

Question Posted: