Split data into groups

1 回表示 (過去 30 日間)
Happy Bear
Happy Bear 2020 年 6 月 3 日
コメント済み: Happy Bear 2020 年 6 月 3 日
Hi,
How can I split data into 3 groups? For example, if I have 300 values, I want 100 lowest values in 1 group, 100 highest values in 1 group and the in-between values in another group.
Thank you

採用された回答

Stephan
Stephan 2020 年 6 月 3 日
編集済み: Stephan 2020 年 6 月 3 日
A = randi(5000,300,1); % random data
A = sortrows(A); % sort it
low = A(1:100); % just use indexing now
mid = A(101:200);
high = A(201:300);
  1 件のコメント
Happy Bear
Happy Bear 2020 年 6 月 3 日
Thank you!

サインインしてコメントする。

その他の回答 (0 件)

Community Treasure Hunt

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

Start Hunting!

Translated by