MATLAB: Experiment noise data (mnoise) which follow a normal distribution with mean 0 and standard deviation of 0.024

normal distributionpower density functionstandard deviation

I am generating 251 experiment noise data (mnoise) which follow a normal distribution with mean 0 and standard deviation of 0.024. And I have to use 'rand' command.
I know how to generate random numbers using rand command. But I don't know how to generate noise data that follows mean=0.5 and sd=0.024. I have been using
Y = normpdf(X,mu,sigma) function.
I also know that normal distribution is a bell shape plot that is based on mean and sd. Please help. Any tips would be very helpful.

Best Answer

Are you sure you have to use the rand() command and not the randn() function?
normpdf() is not for generating random numbers. You can generate data that follows the N(0.5,0.024^2) distribution with
x = 0.5+0.024*randn(251,1);