Question: Write a MATLAB function named top5_temps The function will have one input and two return values The input will be a list of temperatures recorded

Write a MATLAB function named top5_temps

  • The function will have one input and two return values
    • The input will be a list of temperatures recorded every minute in an electric arc furnace (for at least 6 minutes)
    • The first return value of the function should be the number of datapoints in the list (number of minutes of data)
    • The second return value should be a single value that is the average temperature for the 5 highest temperatures.

Notes:

  • Example Test Case: [num, avg] =top5_temps([1850, 1807, 1900, 1845, 1945, 1913]); results in num=6 and avg =1890.6
  • DO NOT include test cases.
  • There is a built-in command to sort in descending order

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!