how to group a matrix using quartile

3 ビュー (過去 30 日間)
farfar
farfar 2018 年 10 月 14 日
回答済み: Walter Roberson 2018 年 10 月 14 日
Hello
assume I have a matrix :
a=[1 0.2;2 0.1;3 0.0002;4 2;5 1;6 0.00004;7 3;8 1.5;9 4]
b=a(:,2)
c = sort(b)
Q1 = median(c(find(c<median(c))))
percentile %25 would be 0.0501, how can i get a new matrix belong under Q1, like:
d=[3 0.0002;6 0.0004]
Thanks !

採用された回答

Walter Roberson
Walter Roberson 2018 年 10 月 14 日
mask = b < quantile(b, 0.25);
a(mask,:)

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeRegression についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by