Create a sample of 1000 values from a normal distribution

8 views (last 30 days)
Create a variable yNormal1 that holds a vector of 1000 values drawn from the normal distribution with mean 1 and standard deviation 1.

Accepted Answer

Stephan
Stephan on 1 Nov 2018
Edited: Stephan on 1 Nov 2018
Hi,
use:
yNormal1 = randn(1,1000) + 1;
or - if you have Statisitcs an Machine Learning Toolbox you can also use:
yNormal1 = random('Normal',1,1,1,1000)
Best regards
Stephan

More Answers (1)

Image Analyst
Image Analyst on 1 Nov 2018
Sound like homework. Hint: check out the help for randn().

Tags

Community Treasure Hunt

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

Start Hunting!