简体   繁体   English

在C ++中生成正态分布的随机数

[英]Generate normal distributed random numbers in C++

I want to generate a vector of n normal-distributed random variables in C++. 我想在C ++中生成n个正态分布随机变量的向量。 In Matlab you can do this with the command "randn(n)", but I haven't found any similar method. 在Matlab中,您可以使用命令“ randn(n)”来执行此操作,但是我还没有找到任何类似的方法。 With best regards Patsch 致以诚挚的问候

如果使用C ++ 11或更高版本,则存在std :: normal_distribution

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM