Difference between unifrnd and rand () functions in matlab
I assume you mean unifrnd
(not " unifrand
").
unifrnd
is part of the statistics toolbar, while it rand
is a basic Matlab function.
unifrand
is just a wrapper rand
that allows you to specify additional parameters to define an interval of random values ββ( rand
outputs values ββin [0,1]). You can do the same with rand
using (a-b)*rand(...)+b
, where a
and b
- the desired interval. Type open unifrnd
in Matlab to see the code unifrnd
.
Another difference is that in recent versions Matlab rand
allows you to specify the data type of the generated output: single
or double
.
source to share