Path: news.mathworks.com!not-for-mail
From: "ade77 " <ade100a@gmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: choosing a number at random
Date: Sun, 8 Nov 2009 02:52:03 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 6
Message-ID: <hd5boi$7bv$1@fred.mathworks.com>
References: <hd57r0$8c2$1@fred.mathworks.com>
Reply-To: "ade77 " <ade100a@gmail.com>
NNTP-Posting-Host: webapp-03-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1257648723 7551 172.30.248.38 (8 Nov 2009 02:52:03 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Sun, 8 Nov 2009 02:52:03 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1059495
Xref: news.mathworks.com comp.soft-sys.matlab:583286


"Monica " <moh__krez@hotmail.com> wrote in message <hd57r0$8c2$1@fred.mathworks.com>...
> I need Matlab to choose a number between 1 and 10 at random, but I'm not sure how to go about doing this.

you might also try randi(max), generates random number from 1:max.

in your case randi(10)