急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!