필터 지우기
필터 지우기

Get distribution percentages of list of values

조회 수: 2 (최근 30일)
Lukas Netzer
Lukas Netzer 2021년 5월 2일
댓글: Lukas Netzer 2021년 5월 3일
I have a list of values:
x =
185726
49585
10342
13788
3656
18303
120647
9627
20600
5035
102547
48199
130645
480909
181281
295472
117750
209453
313996
247037
54794
100530
Now I want to display the percentage of distribution; e.g. xx% are over 100000, or xx% are over 300000. Is there a simple way to do that?
Thanks!
  댓글 수: 1
Lukas Netzer
Lukas Netzer 2021년 5월 2일
to be precise: I want to get those values that are above a certain value and represent 10% of the total amount of values! The list of values is much longer :)

댓글을 달려면 로그인하십시오.

채택된 답변

Image Analyst
Image Analyst 2021년 5월 2일
Is this what you mean?
x = [
185726
49585
10342
13788
3656
18303
120647
9627
20600
5035
102547
48199
130645
480909
181281
295472
117750
209453
313996
247037
54794
100530]
% Find out the values that are in the 10% of values with the highest values.
index = ceil((1 - 0.10) * length(sortedx))
values = sortedx(index:end)
index =
20
values =
295472
313996
480909
  댓글 수: 2
Lukas Netzer
Lukas Netzer 2021년 5월 3일
Thank you very much!
Lukas Netzer
Lukas Netzer 2021년 5월 3일
One more question if I may - the values I am getting are duration times at certain locations - so these are the top 10% locations with the highest duration times. I dont really need their time, but their name. If i have a list C:
Loc1
Loc2
....
Loc82
And x was the according list of duration times. We now got the 10% highest duration times and want to assign them their names yet again, how can I do that?
I thought running a loop could do it, but I am doing it wrong I guess..

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

제품


릴리스

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by