急Matlab已知概​率密度函数,怎么生成​随机数啊?。

望高手帮忙,已知概率密度函数,怎么生成随机数啊?

 채택된 답변

wexaman
wexaman 2022년 11월 16일

0 개 추천

1 calculate the cumulative function (Not the density function), it will be in range (0, 1)
2 generate random number by 'rand', which will be (0, 1)
3 e.g., one random number is 0.6, substitute it into the cumulative function, you will get one random number from your designated distrubiton

추가 답변 (1개)

qiao huang
qiao huang 2022년 12월 9일

0 개 추천

您好这个问题您解决了吗?

카테고리

도움말 센터File Exchange에서 随机数生成에 대해 자세히 알아보기

태그

질문:

2022년 11월 16일

답변:

2022년 12월 9일

Community Treasure Hunt

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

Start Hunting!