Mon 04 Sep 2017 01:33:33 PM UTC, original submission:
The documentation of function rand is incomplete.
In addition it is outdated, because matlab moved a little bit.
I suggest to update documentation first
before, somewhere in future upgrade for sake of matlab compatibility.
I think, a sentence like
is not what the user wants to read, it should be more explicit,
and it should be correct.
In detail:
1.
The case rand() without argument behaves like rand(1)
which is not documented.
This is like eye().
rand(2,3,4) is documented and is allowed whereas eye(2,3,4) is not (eye is restricted to two arguments maximum).
Accordingly, rand([2,3,4]) is allowed and is the same as rand(2,3,4)
These two cases are not like eye which shows,
that we need a separate description.
The return values are missing in most cases:
so rand(n) must be replaced by m=rand(n).
As documented for eye, the variants
are also allowed with additional argument CLASS as
What is also missing is an explicit enumeration of the allowed values for CLASS, namely
'double', 'single', 'logical', 'int8', 'uint8', 'int16', 'uint16', 'int32', 'uint32', 'int64', or 'uint64',
in particular: logical!!!!
It does not make sense, to state the variants with seed and state before all those are described becaues
rand('state','double') does not work!!
So we have to mention first:
Then one has to describe the variants
for which it is really true, that V is a vector
and the other variants have no return value.
What is missing is the documentation for second argument 'reset'
which i found nowhere.
Accordingly for 'seed' replacing 'state'.
For the other variants,
|