Info
此问题已关闭。 请重新打开它进行编辑或回答。
How to distribute allredy generated random Number
3 次查看(过去 30 天)
显示 更早的评论
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
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
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!