How to generate data with a specific distribution
12 次查看(过去 30 天)
显示 更早的评论
Matlab provides random number generating from a uniform distribution (rand). Is there a way to generate data from other distributions that Matlab supports like Chi-Square??
Sajad
1 个评论
PRIYANKA upadhyay
2013-7-3
hello, u have write here that Matlab provides random number generating from a uniform distribution (rand)....can u pls tell exactly how can i generate random nos...
回答(2 个)
Laura Proctor
2011-7-8
Use the random function. Here's an example of creating a 10x3 matrix of random numbers using a Chi-Square distribution with 2 degrees of freedom:
y = random('chi2',2,10,3)
0 个评论
Oleg Komarov
2011-7-8
Otherwise to get a chi-squared just generate standard normals and sum their squares: http://en.wikipedia.org/wiki/Chi-square_distribution
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Random Number Generation 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!