MATLAB: Normally random number generator with limited zone

duplicate post requiring mergingnormal distribution -random number generator

tnx in advance, i have 3 random variables.that every of that 3 related to a another(*) one(of course)its random too.i use normal distribution generator for monte carlo simulation in matlab to produce RAndom number.but in some cases with mention to unlimited zone of generating random number my final data(*)will be negative.that is not accurate and unexplainable for my job(bearing capacity-geotechnical eng.)i choose normally dist. because its the best match for my data and bell type format of its distribution also help me and i have to use it..also i need to generate positive random number with this normal dist.i think i should find a way to limit this generator to produce random number between -1 & 1 or even find a way to use this distribution with desirable mean and standard deviation..

Best Answer

This function will generate a normal distribution conditional by bounds:
http://www.mathworks.com/matlabcentral/fileexchange/23832-truncated-gaussian