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

randi function not available in my MATLAB R2008a

571 views
Skip to first unread message

Jonas Camillus Jeppesen

unread,
Mar 16, 2010, 4:07:02 AM3/16/10
to
Hi everyone

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

Jonas Camillus Jeppesen

unread,
Mar 16, 2010, 4:30:27 AM3/16/10
to
If you have no other suggestions maybe you could just post your MATLAB version and whether or not you have access to the randi() function?

That would also be a great help.

Thank you.

Husam Aldahiyat

unread,
Mar 16, 2010, 5:55:23 AM3/16/10
to
"Jonas Camillus Jeppesen" <wuh...@hotmail.com> wrote in message <hnne76$ovq$1...@fred.mathworks.com>...

Student version doesn't have randi().

Jonas Camillus Jeppesen

unread,
Mar 16, 2010, 6:18:06 AM3/16/10
to
"Husam Aldahiyat" <numa...@gmail.com> wrote in message <hnnkib$7v8$1...@fred.mathworks.com>...

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...

David Young

unread,
Mar 16, 2010, 6:40:09 AM3/16/10
to
How about working round it with

ceil(imax*rand(m,n))

Steve Eddins

unread,
Mar 16, 2010, 7:07:05 AM3/16/10
to

randi is not in R2008a. It was added to MATLAB in R2008b.

---
Steve Eddins
http://blogs.mathworks.com/steve/

Steven Lord

unread,
Mar 16, 2010, 10:27:30 AM3/16/10
to

"Jonas Camillus Jeppesen" <wuh...@hotmail.com> wrote in message
news:hnne76$ovq$1...@fred.mathworks.com...

> Hi everyone
>
> Every time I try to use the randi() function
> (http://www.mathworks.com/access/helpdesk/help/techdoc/ref/randi.html)
> MATLAB just respond:

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


Steven Lord

unread,
Mar 16, 2010, 10:29:43 AM3/16/10
to

"Husam Aldahiyat" <numa...@gmail.com> wrote in message
news:hnnkib$7v8$1...@fred.mathworks.com...

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.

Peter Perkins

unread,
Mar 16, 2010, 10:54:59 AM3/16/10
to
On 3/16/2010 10:27 AM, Steven Lord wrote:
> Perhaps you wrote your own version of RANDI using RAND, CEIL, and
> appropriate scaling?

In fact, MATLAB versions prior to R2008b has this as an example in the help for RAND. It's a one liner.

David Young

unread,
Mar 16, 2010, 11:09:08 AM3/16/10
to
Peter Perkins <Peter....@MathRemoveThisWorks.com> wrote in message <hno643$9b7$1...@fred.mathworks.com>...

Yes, a bit like the one I put in this thread earlier!

Jonas Camillus Jeppesen

unread,
Mar 16, 2010, 11:49:24 AM3/16/10
to
Thanks guys, this clears things up :)

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.

0 new messages