percentrank

Version 1.0.1 (1.35 KB) by Emmanuel
Rank of a value in an array
1 Download
Updated 21 Sep 2025

View License

A = [1 1 1 2 3 4 8 11 12 13];
x = 2; % 0.333
r = percentrank(A,x);
fprintf("Percent rank of %d is %.4f\n",x,r)
x = 4; % 0.555
r = percentrank(A,x);
fprintf("Percent rank of %d is %.4f\n",x,r)
x = 8; % 0.666
r = percentrank(A,x);
fprintf("Percent rank of %d is %.4f\n",x,r)
x = 5; % 0.583
r = percentrank(A,x);
fprintf("Percent rank of %d is %.4f\n",x,r)

Cite As

Emmanuel (2025). percentrank (https://au.mathworks.com/matlabcentral/fileexchange/182074-percentrank), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2025b
Compatible with any release
Platform Compatibility
Windows macOS Linux
Tags Add Tags

Community Treasure Hunt

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

Start Hunting!
Version Published Release Notes
1.0.1

Image update

1.0.0