Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: randperm
Date: Sat, 26 Jul 2008 20:14:02 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 26
Message-ID: <g6g0ia$vp$1@fred.mathworks.com>
References: <g6fu97$7ru$1@fred.mathworks.com>
Reply-To: <HIDDEN>
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 1217103242 1017 172.30.248.38 (26 Jul 2008 20:14:02 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Sat, 26 Jul 2008 20:14:02 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 939004
Xref: news.mathworks.com comp.soft-sys.matlab:481988



"ching l" <chinglnc@hotmail.com> wrote in message
<g6fu97$7ru$1@fred.mathworks.com>...
> a= randperm(6)
> 
> I want the "a" to have different number each time, between 
> 1 to 6.  However, by using randperm, it called out all the 6
> random numbers at a time, which become a= 1 4 6 2 3 5
> 
> How do I have different random "a" each time?
> 
> for example, 
> 
> a= 1
> 
> a= 3
> 
> a= 5
> 
> instead of a= 1 4 2 6 3 5
> 
> 
> 



a=ceil(6*rand)