how do i get the top 10 percent of the matrix value
6 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
jun xian ng
il 20 Ott 2015
Commentato: Star Strider
il 20 Ott 2015
so basically I have a matrix of 20x20. I need to extract out the top 10 percentage of the value and put it into a vector form. how should I do it?
0 Commenti
Risposta accettata
Star Strider
il 20 Ott 2015
This seems to do what you want:
M = randn(20); % Create Data
Ms = sort(M(:),'descend'); % Sort Descending
Result = Ms(1:ceil(length(Ms)*0.1)); % Desired Output
4 Commenti
Più risposte (1)
Walter Roberson
il 20 Ott 2015
V = sort(YourMatrix(:), 'reverse');
Top10 = V(1:ceil(end/10));
0 Commenti
Vedere anche
Categorie
Scopri di più su Creating and Concatenating Matrices in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!