MATLAB: Makedist discrete uniform distribution

makedist

Hi all
I am trying to create a uniform discrete distribution, with 5 values (20% probability each), by using makedist command
However, I am bit confused with the boundaries.
My values I want to be : 20,25,30,35,40
Can you please help?
thanks
Nikolas

Best Answer

It appears that MATLAB will only give you random integers 1..K for any K you want, so you will have to convert those to your desired values, e.g.:
myrandoms = 15 + randi(5,100,1)*5 % A vector of 100 random numbers from your set