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

Write a user-defined function that fmds 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 4 × 6 matrix using the following command: x=randi ( [-20 100] ,4,6)

Step by Step Solution

3.29 Rating (158 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Script file x randi 20 10046 Emrc matrixmax x Function fi... View full answer

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

Document Format (1 attachment)

Word file Icon

652-B-F-F-M (748).docx

120 KBs Word File

Students Have Also Explored These Related Finance Questions!