Path: news.mathworks.com!not-for-mail
From: "ching l" <chinglnc@hotmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: randperm
Date: Sun, 27 Jul 2008 13:58:02 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 36
Message-ID: <g6huta$4pa$1@fred.mathworks.com>
References: <g6fu97$7ru$1@fred.mathworks.com> <g6g0ia$vp$1@fred.mathworks.com> <g6g1m3$cec$1@fred.mathworks.com> <g6hdm9$j18$1@fred.mathworks.com> <g6hqc7$gck$1@fred.mathworks.com> <g6hr97$sq6$1@fred.mathworks.com>
Reply-To: "ching l" <chinglnc@hotmail.com>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1217167082 4906 172.30.248.37 (27 Jul 2008 13:58:02 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Sun, 27 Jul 2008 13:58:02 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1438759
Xref: news.mathworks.com comp.soft-sys.matlab:482062



"Bruno Luong" <b.luong@fogale.findmycountry> wrote in
message <g6hr97$sq6$1@fred.mathworks.com>...
> "ching l" <chinglnc@hotmail.com> wrote in message
> <g6hqc7$gck$1@fred.mathworks.com>...
> 
> > 
> > so, when I call the wavplay everytime, it should play
> > different audio each time. 
> > 
> > but randperm(6) = (3 4 5 1 2 6);
> > 
> > possible to work around with that?
> 
> Work around of what problem ?
> Just playing track #3, then 4, 5, 1, 2, and then 6 according
> to randperm result. Wasn't that a six number randomly chosen
> and never repeated? Isn't that what you asked for???
> 
> Bruno

The error- Too many input arguments.

wavplay (sample{randperm(6)});

because it's using six random numbers at a time.
I only want it to play one random number at a time.
That means, whenever I call the wavplay function, it will
randomly choose from 1 to 6, and when I call that function
again, it will choose from 1 to 6, but not the same number
that used before that.