Path: news.mathworks.com!not-for-mail
From: "ching l" <chinglnc@hotmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: no repeat for rand
Date: Thu, 24 Jul 2008 08:55:23 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 25
Message-ID: <g69g1r$60c$1@fred.mathworks.com>
References: <g69avu$ai0$1@fred.mathworks.com> <g69bin$ff5$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 1216889723 6156 172.30.248.37 (24 Jul 2008 08:55:23 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Thu, 24 Jul 2008 08:55:23 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1438759
Xref: news.mathworks.com comp.soft-sys.matlab:481452



"us " <us@neurol.unizh.ch> wrote in message
<g69bin$ff5$1@fred.mathworks.com>...
> "ching l":
> <SNIP nonrandomly randomness...
> 
> > is it possible to limit rand value so that it doesn't 
> repeat...
> 
> a hint:
> 
>      help randperm;
> 
> us


It says exceeds matrix dimensions, any idea why?

a{5} = {audio, fs};

fixrand= ceil(length(samples)*rand);
fixrand= randperm(5); 

wavplay(a{fixrand)}{:});