create random number with gaussian distribution

조회 수: 1 (최근 30일)
evangeline
evangeline 2018년 2월 18일
답변: Birdman 2018년 2월 18일
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