필터 지우기
필터 지우기

How can I allocate chances to a distribution

조회 수: 1 (최근 30일)
Ruben Verkempynck
Ruben Verkempynck 2011년 5월 4일
Hi guys,
I know the function rand() gives a parameter a range with a uniform distribution. How can I bias this distribution (read: not a uniform distribution) that the lowest part of the range is sampled more often, or the top part, etc.
Thanks, Ruben

채택된 답변

Oleg Komarov
Oleg Komarov 2011년 5월 4일
rnd = rand(100,1)*100;
% Oversample interval [a b] = [80 100]
a = 80;
b = 100;
rnd = [rnd; a + (b-a)*rand(100,1)];
scatter(rnd,ones(200,1),'.')

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Random Number Generation에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by