MATLAB: How to write a Gaussian distributed number in m-file with mean =30 and var=100

MATLABrandom number generator

plz i need to write a m-file contains value of gaussian distribution number with mean defined mean and variance. my question is how to insert this value?. will i generate it by rand function or write it as it is given in simulation parameters??

Best Answer

randn(desired_array_size) * sqrt(desired_variance) + desired_mean