Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

problem with random function

6 views
Skip to first unread message

Alessandro

unread,
Nov 7, 2012, 1:20:12 PM11/7/12
to
Hi all,
I have a big problem because few days ago it was all working well and now nothing...

I cant' use this function in MATLAB, neither from the command line: http://www.mathworks.it/it/help/stats/random.html

if I try to do this: random('Uniform',0,1)
it returns:
"Error using rand
Seed must be a double scalar.
Error in random.seed (line 39)
rand('seed',uiseed); % Initialize seed
Error in random (line 24)
random.seed(iseed);"

I've used the random function because was more clear in the code, but now doesn't go anymore...
Can anyone help me? Have I to reinstall MATLAB?

Steven_Lord

unread,
Nov 7, 2012, 1:45:13 PM11/7/12
to


"Alessandro " <dehno...@gmail.com> wrote in message
news:k7e8os$j6h$1...@newscl01ah.mathworks.com...
> Hi all,
> I have a big problem because few days ago it was all working well and now
> nothing...
>
> I cant' use this function in MATLAB, neither from the command line:
> http://www.mathworks.it/it/help/stats/random.html
>
> if I try to do this: random('Uniform',0,1)
> it returns:
> "Error using rand
> Seed must be a double scalar.
> Error in random.seed (line 39)

This makes me suspect that you have a class on your path named random that
is shadowing the Statistics Toolbox function. Execute this command to test
this hypothesis:

which -all random

If the first line is NOT the random.m from Statistics Toolbox, rename or
delete the random class, remove the directory containing it from the MATLAB
path, or move it lower on the path than Statistics Toolbox.

*snip*

--
Steve Lord
sl...@mathworks.com
To contact Technical Support use the Contact Us link on
http://www.mathworks.com

Alessandro

unread,
Nov 7, 2012, 2:15:11 PM11/7/12
to
"Steven_Lord" <sl...@mathworks.com> wrote in message <k7ea7o$p8k$1...@newscl01ah.mathworks.com>...
You're the best! I was going crazy!
It was just a path added yesterday for another project which included a file random.m
Thanks a lot!

Peter Perkins

unread,
Nov 7, 2012, 2:15:21 PM11/7/12
to
You should get rid of the class (?) because it appears to be using a
very old random number generator syntax ("rand('seed',s)") that causes
MATLAB to use a very outdated random number generator.
0 new messages