Question: Matlab Function Name: marinaraTrench nputs: 1. (double) An NxM array of depths Outputs: 1. (double) The shallowest point of the trench (double) The deepest point

 Matlab Function Name: marinaraTrench nputs: 1. (double) An NxM array of

Matlab Function Name: marinaraTrench nputs: 1. (double) An NxM array of depths Outputs: 1. (double) The shallowest point of the trench (double) The deepest point of the trench 2. Banned Functions min(), max(), sort) Background: As we know, pirates roma the seas. "ba-dum-tsss Function Description: Given an array of trench depths, find and return both the shallowest and the deepest points of the trench, which will be the minimum and maximum values of the array, respectively Trench depths will be represented by doubles Example: trench 3.5, 6.5, 26.3, 90.3, 62.2 11.4, 14.5, 25.6, 82.1, 70.9 18.3, 24.2, 27.2, 100.4, 108.2 12.3, 3.2, 36.2, 92.5, 34.2 [shallow, deep] marinaraTrench(trench); shallow3.2 deep 108.2 Notes: You only need to iterate through the array once The array will have at least one element in it

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 Databases Questions!