MATLAB: Ranking Numbers based on Size

assigninequalityranking

I have a large dataset of numbers, and am attempting to assign a number to each of them — ranking smallest to largest.
A = [1 5 0 9 6 4]
The following is an example, where the numbers on the right are from the row vector 'A', and the numbers on the right are "assigned" based on how large the numbers are:
1 — 2
5 — 4
0 — 1
9 — 6
6 — 5
4 — 3
Thank you!

Best Answer

A = [1 5 0 9 6 4]
[~, ~, R] = unique(A)