The function unifrnd
returns random numbers sampled from a uniform distribution. The first two arguments determine the lower and upper bounds. The remaining (optional) arguments determine the shape of the result. So, for example, to get random numbers between 1 and 3.1:
octave:12> unifrnd(1, 3.1)
ans = 2.4990
octave:13> unifrnd(1, 3.1)
ans = 3.0240
octave:14> unifrnd(1, 3.1, 2, 3)
ans =
1.8929 2.9675 2.1239
2.4756 2.6172 1.6197
(The results are regular floating point numbers. I don't understand why you are asking about rational numbers.)