rand() : creates uniform random numbers ("with replacement") in the range (0,1) exclusive. To create uniform random numbers in the range (a,b) exclusive, use rand()*(b-a)+a . The only arguments for rand() are the sizes of the resulting array.
randn(): creates random number on the normal distribution ("with replacement") with mean 0 and standard deviation 0. The create normally distributed random numbers with mean a and standard deviation b, use randn()*b + a . The only arguments for randn() are the sizes of the resulting array.
randi(): creates uniform distributed random integers ("with replacement") in a range. If the first argument is a scalar, the range is 1 to that scalar. If the first argument is a vector of length 2, then the range is from the first integer to the second integer. The arguments after the first one are the sizes of the resulting array.
If you need uniform random integers without replacement on the range [a b] then use randperm(b-a+1)+a-1