create random number with gaussian distribution

1 次查看(过去 30 天)
I need to create a random number with gaussian distribution and with average value of 0 and var of 1. like N(0,1). and also a N(0,10). how can i do this with matlab?

采纳的回答

Birdman
Birdman 2018-2-18
For one single number, use
R = normrnd(0,1)
for an 1x10 array:
R = normrnd(0,1,[1 10])

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Random Number Generation 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by