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