Every time I try to use the randi() function (http://www.mathworks.com/access/helpdesk/help/techdoc/ref/randi.html) MATLAB just respond:
>> randi(10,100,1)
??? Undefined function or method 'randi' for input arguments of type 'double'.
and Help found in my MATLAB can not find any function called randi.
I use MATLAB version 7.6.0.324 (R2008a) and I'm fairly sure I've used this function on this version of MATLAB before.
Can anyone enlighten me?
Best regards
Jonas C. Jeppesen, Denmark
That would also be a great help.
Thank you.
Student version doesn't have randi().
And what makes my version a student version? Are all the RXXXXy versions student versions or? My program is made available to me through my university...
ceil(imax*rand(m,n))
randi is not in R2008a. It was added to MATLAB in R2008b.
---
Steve Eddins
http://blogs.mathworks.com/steve/
Note that the online documentation is the documentation for the most recent
release of MATLAB (right now, that would be release R2010a) and so may
describe features that are not present in older releases.
>>> randi(10,100,1)
> ??? Undefined function or method 'randi' for input arguments of type
> 'double'.
>
> and Help found in my MATLAB can not find any function called randi.
>
> I use MATLAB version 7.6.0.324 (R2008a) and I'm fairly sure I've used this
> function on this version of MATLAB before.
>
> Can anyone enlighten me?
As Steve Eddins said, you're one release too early. Take a look at this
section of the release R2008b Release Notes:
http://www.mathworks.com/access/helpdesk/help/techdoc/rn/brqyzsl-1.html
Perhaps you wrote your own version of RANDI using RAND, CEIL, and
appropriate scaling?
--
Steve Lord
sl...@mathworks.com
comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ
The problem is not Student Version versus non-Student Version -- the problem
is that RANDI was released in release R2008b.
There are a few differences between Student Version and the professional
version:
http://www.mathworks.com/academia/student_version/details.html
but the presence or absence of the RANDI function is not one of them.
In fact, MATLAB versions prior to R2008b has this as an example in the help for RAND. It's a one liner.
Yes, a bit like the one I put in this thread earlier!
I must have been using a newer version of MATLAB when I used randi() last time, because I've not been using the workaround you suggest.
Thanks again.