Clear Filters
Clear Filters

how can i create 12 monthly maxima from a uniform distribution between 0 and 6? (using unifrnd)

1 view (last 30 days)
I've tried use the function unifrnd to create for each of 12 months, a random value from 0 to six but something goes wrong. I've used this code:
>> a = 0; b = 1:6; >> R = unifrnd(a,b,[1,12])

Accepted Answer

Andrei Bobrov
Andrei Bobrov on 4 Jul 2018
R = unifrnd(a,b(end),[1,12]);
or
R = rand(1,12)*b(end);

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!