필터 지우기
필터 지우기

How to get the top 5% number and bottom 5% number of a matrix

조회 수: 3 (최근 30일)
Tommy
Tommy 2012년 5월 27일
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.

채택된 답변

Oleg Komarov
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개)

카테고리

Help CenterFile Exchange에서 Logical에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by