A function that achieves the random sampling effect you want is randsample().
To get one random sample from your specified population, use this.
randsample([20 25 30 35 40], 1)
To get ten random samples, use this.
randsample([20 25 30 35 40], 10, 1)
I do not know how to get this effect out of a call to makedist(). However, you can create your own distribution object that behaves like objects returned by makedist(). This would involve creating a class. It will need to be a subclass of ProbabilityDistribution, and probably a subclass of UnivariateDistribution or TruncatableDistribution as well. These classes are part of the shared stats library that makedist uses.