Question: 29. Write a user-defined MATLAB function that finds the largest element of a matrix. For the function name and arguments, use [Em,rc] = matrixmax( A),

29. Write a user-defined MATLAB function that finds the largest element of a matrix. For the function name and arguments, use [Em,rc] = matrixmax(

A), where A is any size matrix. The output argument Em is the value of the largest element, and rc is a two-element vector with the address of the largest element (row and column numbers). If there are two, or more, elements that have the maximum value, the output argument rc is a two-column matrix where the rows list the addresses of the elements. Test the function three times. For input create a matrix using the following command: x=randi([-20 100],4,6).

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Systems Analysis And Design Using MATLAB Questions!

Q:

a