How to distribute data as Gaussian?

1 回表示 (過去 30 日間)
Nadatimuj
Nadatimuj 2022 年 4 月 4 日
回答済み: Sam Chak 2022 年 4 月 4 日
Let's say I have 800 colors. I want to distribute it between 10 people. If I distribute it unformly, I would simply give 80 colors to each people. How can I disrubute it in a Gaussian manner? Which Matlab function can distribute 800 colors among 10 people Gaussian way?

回答 (2 件)

Bruno Luong
Bruno Luong 2022 年 4 月 4 日

Sam Chak
Sam Chak 2022 年 4 月 4 日
This is just one of many possibilities to distribute the number of colors to 10 people according to the Gaussian function.
x = 1:10;
y = 161*exp(-(1/2)*((x - 5.5)/2).^2);
y = round(y);
bar(x, y)
sum(y)
ans =
800
Result:

製品


リリース

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by