how to print a matrix as ranked sorted list?

if I have this matrix [56 9 8 7 4 5 6 3 35 4 ] How to print is as
Rank Score
1 56.00
2 35.00
3 9.00
4 8.00
5 7.00
6 6.00
7 5.00
8 4.00
9 4.00
10 3.00

Risposte (1)

Stephen23
Stephen23 il 17 Feb 2018
Modificato: Stephen23 il 17 Feb 2018
V = [56,9,8,7,4,5,6,3,35,4];
fprintf('Rank Score\n')
fprintf('%4d %.2f\n',[1:numel(V);sort(V,'descend')])

Categorie

Richiesto:

il 17 Feb 2018

Modificato:

il 17 Feb 2018

Community Treasure Hunt

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

Start Hunting!

Translated by