How could i generate 10000 samples of a random variable uniformly distributred in(0,1)??
显示 更早的评论
Dear Sir/Madam, How could i generate 10000 samples of a random variable uniformly distributred in(0,1)??
4 个评论
Purushottama Rao
2015-8-19
编辑:Purushottama Rao
2015-8-19
Are you lookig for somethinglike
rand(10000,1)
HARI PRASAD
2015-8-19
Walter Roberson
2015-8-19
Yes.
HARI PRASAD
2015-8-19
回答(1 个)
Purushottama Rao
2015-8-19
编辑:Purushottama Rao
2015-8-19
In your code,loop should start form 1. i=1:1:1000
However inorder to acheieve what you have wanted, you may not need a loop.
X= rand(1,10000);
Y=rand(1,10000);
k=sqrt(X.^2+Y.^2)
k is the result
类别
在 帮助中心 和 File Exchange 中查找有关 Random Number Generation 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!