how can i set random number generation limit?

6 ビュー (過去 30 日間)
Dhruvalkumar Patel
Dhruvalkumar Patel 2019 年 9 月 16 日
回答済み: Walter Roberson 2019 年 9 月 16 日
how can i set the limit for the data collection for New_cp should be the between 0.1 to 0.59?
size=1e6;
a=randn(size,3);
ad1=makedist('Normal',0,1); a1 = cdf(ad1,a(:,1));
pd2 = makedist('Beta',2,5); New_Cp = icdf(pd2,a1);
hist(New_Cp,25)
  6 件のコメント
Guillaume
Guillaume 2019 年 9 月 16 日
"I need limit for the random number generation" doesn't clarify anything. Asking precise question with as many details as possible is the best way to get a fast answer.
Completely unrelated, naming a variable size is an extremely bad idea as it will prevent you from using the function with the same name.
Dhruvalkumar Patel
Dhruvalkumar Patel 2019 年 9 月 16 日
the upper limit is 0.59 and lower limit is 0.2

サインインしてコメントする。

回答 (1 件)

Walter Roberson
Walter Roberson 2019 年 9 月 16 日
You will need to use https://www.mathworks.com/help/stats/prob.normaldistribution.truncate.html to truncate the probability distribution.

タグ

製品


リリース

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by