can you pls help in solving the following question for random variables:
1 回表示 (過去 30 日間)
古いコメントを表示
kratika kanherkar
2016 年 8 月 3 日
コメント済み: kratika kanherkar
2016 年 8 月 6 日
Generate 10 uniform random variables within the range 0 and 2 and evaluate their sum and sketch the pdf for resulting random variable
&
Generate 10 exponential random variable with lambda=2 and evaluate their sum.
0 件のコメント
採用された回答
Image Analyst
2016 年 8 月 5 日
編集済み: Image Analyst
2016 年 8 月 5 日
For the first question on uniform numbers, see the help for rand() - the answer is one of the examples.
For sketching the PDF, see histogram(), particularly the 'pdf' option.
for the exponential numbers, see the help for random() in the Statistics and Machine Learning Toolbox, if you have that. Exponential is one of the distributions you can select.
その他の回答 (1 件)
Jan Jarosz
2016 年 8 月 5 日
編集済み: Walter Roberson
2016 年 8 月 5 日
u = 2*rand(10,1);
usum = sum(u); %uniform rv
lambda = 2;
e = exprnd(1/lambda,10,1);
esum = sum(e);%exponential rv
The pdf will always be f(x)=0.5, 0<x<2 for the uniform distribution and 2*exp(-2*x) for the exponential distribution. You can plot histograms with hist(u) and hist(e)
参考
カテゴリ
Help Center および File Exchange で Creating and Concatenating Matrices についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!