MATLAB: Top Average

homeworkmatrices

Create a Matlab function according to the following:
Function name: topaverage
Input:
1. list of real numbers
2. real number
Output:
1. real number that is the average of all items in input #1 that are
equal to or greater than input #2
Example:
r=topaverage([3 6 10 12], 10)
r =
11
How do I get the program to relate the input #2 to one of the elements in the list and only start the average calculation from there? I know I have to sort from lowest to largest… I'm just stuck.

Best Answer

I actually figured it out last night.
Thank you