Path: news.mathworks.com!not-for-mail
From: "ching l" <chinglnc@hotmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: randperm
Date: Sat, 26 Jul 2008 19:35:03 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 20
Message-ID: <g6fu97$7ru$1@fred.mathworks.com>
Reply-To: "ching l" <chinglnc@hotmail.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 1217100903 8062 172.30.248.38 (26 Jul 2008 19:35:03 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Sat, 26 Jul 2008 19:35:03 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1438759
Xref: news.mathworks.com comp.soft-sys.matlab:481986



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