How to generate data with a specific distribution

9 ビュー (過去 30 日間)
Sajjad Taghvaee
Sajjad Taghvaee 2011 年 7 月 8 日
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
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
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)

Oleg Komarov
Oleg Komarov 2011 年 7 月 8 日
If you have the stats toolbox with random you can chose from a set of distributions.
Otherwise to get a chi-squared just generate standard normals and sum their squares: http://en.wikipedia.org/wiki/Chi-square_distribution

カテゴリ

Help Center および File ExchangeRandom Number Generation についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by