Mar 8, 2020

C/C++ normal distribution example (C/C++ 정규분포 예제)

- Example of normal distribution implemented in C/C++language.
- C/C++ 로 구현한 정규분포 예제 

//////////////////////////////////////////////////////////////////

#include <random>

int main(void){

 default_random_engine generator;
 normal_distribution<double> distribution(0,1); // mean: 0, standard deviation: 1

 while(1){

 double number = distribution(generator);
 cout<<"#:"<<number<<endl;

 }
 return 0;
}
//////////////////////////////////////////////////////////////////

* Screen shot of printed output data (출력된 데이터 스크린 샷)

//////////////////////////////////////////////////////////////////
* Plot in MATLAB (MATLAB 에서 plot한 그래프)


No comments:

Post a Comment