How to get the top 5% number and bottom 5% number of a matrix
3 ビュー (過去 30 日間)
古いコメントを表示
After 10000 trajectories of a stochastic differential equation of 55 steps, I get a 10000*55 matrix of results. At present, I want to choose top 5% and bottom 5% of the results in each step, but I do not know which code could help me finish this. Would anyone please help me? Thanks a lot.
0 件のコメント
採用された回答
Oleg Komarov
2012 年 5 月 27 日
% Rounded 5%
pt = round(10000*0.05);
% Sort (each column) and take top and bottom 5%
A = sort(A);
top5 = A(1:pt,:);
bot5 = A(end-pt+1:end,:);
その他の回答 (0 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!