Tuesday, December 13, 2011

How to percentile in Matlab?

Problem
-------------
Find the 68.27 percentile of the following matrix


>> Mat=[20 10 45 58 69 90 58 38 29 60 70]

Mat =

    20    10    45    58    69    90    58    38    29    60    70

Solution [as mention in here]
-------------
1. Sort Mat in ascending or descending order

>> sort(Mat)

ans =

    10    20    29    38    45    58    58    60    69    70    90

2. Finding the rank

>> rank_of_6827_percentile=(68.27/100)*size(Mat,2)+0.5

rank_of_6827_percentile =

    8.0097

Therefore, 68.27 percentile is the 8th number of the sorted list and which is 60






No comments:

Post a Comment

Please ask if anything is not clear enough..........