how i can calculate the average of the top numbers

10 views (last 30 days)
i have 20 numbers , i need to calculate the average of the top 8 scores , how i can do it using matlab

Accepted Answer

Azzi Abdelmalek
Azzi Abdelmalek on 30 Nov 2013
If A is your vector
b=sort(A,'descend')
out=mean(b(1:8))
  4 Comments
Image Analyst
Image Analyst on 30 Nov 2013
You can find sorting routines on the internet, for example wikipedia. You can program that up yourself - I don't think you need us for that.

Sign in to comment.

More Answers (0)

Categories

Find more on Shifting and Sorting Matrices in Help Center and File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!