Q:

Distribution in random function in Matlab

I use random function in matlab to produce an integer between [1, n] with random function. For
example random('unid', n) produce every time a number between [1, n]. What  if I want to change the distribution from uniform to another. How can I indicate to random that i want an
integer between [1, n]??????????

A:

exprnd uses exponential distribution. That's the easy way.
Otherwise, AFAIK, you'd use the theory to implement the random generation and the use of the distribution on it.

