mathlab

profileSixtony
HW21.pdf

EGN 4453 Homework 2

Due Monday, October 31, 2022th 11:59pm

For all MATLAB codes written, appropriate comments are re- quired. Solutions must be uploaded in PDF format to Canvas.

1. Write a MATLAB user-defined function that finds the index of the max- imum absolute value within a range of indices in an array. For example, if we had the array [1 0 -12 14 7], and we called the function with the range 1,3, the function would return 3 as the index of the location of the number -12. If the function was called with the range 2,5, the function would return 4, the location of 14.

2. Write a MATLAB user-defined function that interchanges two rows in a matrix, element by element.

3. Write a MATLAB user-defined function to pivot a matrix, if necessary, using the functions written in Parts 1 and 2.

1