Info

この質問は閉じられています。 編集または回答するには再度開いてください。

How to distribute allredy generated random Number

1 回表示 (過去 30 日間)
Sara Shafiee
Sara Shafiee 2019 年 7 月 21 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
Hi,
I've already generated 250 random numbers with log normal distribution between 3 and 200 in matlab. Now I should classificate (I mean distribute) these numbers into 6 Part(Group), 3 part(Group) for values lower and equal 20 and 3 part for values upper than 20. But they should be distributed uniformly (equally) -- equally -- I mean it shouldn't, for example, all number near to 20 collected into one group, and in other all values near 3. they should be so distributed that if we represent with histogram come for each one like normal, or log normal, distribution out.
  2 件のコメント
dpb
dpb 2019 年 7 月 21 日
Doesn't make any sense to me...how can you separate a group that are <20 and then not have the other group also include some that are not those smaller?
Need a better explanation of what you're trying to accomplish with, perhaps, an example using just 20 random variates illustrating might help.
Image Analyst
Image Analyst 2019 年 7 月 21 日
編集済み: Image Analyst 2019 年 7 月 21 日
I agree the explanation is confusing and contradictory. How can the numbers be distributed both log normally and uniformly? Do you simply want to divide your set up into 6 groups, which should all have roughly the same distribution, like:
sortedNumbers = sort(yourNumbers, 'ascend');
group1 = sortedNumbers(1:6:end);
group2 = sortedNumbers(2:6:end);
group3 = sortedNumbers(3:6:end);
group4 = sortedNumbers(4:6:end);
group5 = sortedNumbers(5:6:end);
group6 = sortedNumbers(6:6:end);
This will be slightly biased. There is a way to do it unbiased by making a 2-D matrix out of your numbers, and randomly picking a column from each row for each of the groups, but it's more code, especially since 250 is not a multiple of 6.

回答 (0 件)

この質問は閉じられています。

Community Treasure Hunt

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

Start Hunting!

Translated by