Generating random variable from certain standard deviation and mean

82 ビュー (過去 30 日間)
Alin Brad
Alin Brad 2019 年 7 月 19 日
回答済み: Alin Brad 2019 年 7 月 22 日
Could you please help me how can I generate random variable from Gaussian distribution with zero mean and 0.3 standard deviation?
  2 件のコメント
John D'Errico
John D'Errico 2019 年 7 月 19 日
Bob - Note that the page you are sending them too is a question asking how to generate numbers that have a truncated normal distribution. That is different.
Bob Thompson
Bob Thompson 2019 年 7 月 19 日
Fair point. The finer points of math are not my strong suit, so I was going based on the title.

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

採用された回答

Andrei Bobrov
Andrei Bobrov 2019 年 7 月 19 日
編集済み: Andrei Bobrov 2019 年 7 月 19 日
a = .3;% standard deviation
b = 0; % mean
out = a.*randn + b;

その他の回答 (2 件)

Torsten
Torsten 2019 年 7 月 19 日
n = 100;
x = 0.3*randn(n,1)
generates 100 normally distributed random numbers with mean 0 and standard deviation 0.3.

Alin Brad
Alin Brad 2019 年 7 月 22 日
Thank you alot guys for the helpful comments!

カテゴリ

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