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 13:03:11 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 46
Message-ID: <g69uif$nne$1@fred.mathworks.com>
References: <g69avu$ai0$1@fred.mathworks.com> <g69bin$ff5$1@fred.mathworks.com> <g69g1r$60c$1@fred.mathworks.com> <g69pun$lo$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 1216904591 24302 172.30.248.38 (24 Jul 2008 13:03:11 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Thu, 24 Jul 2008 13:03:11 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1438759
Xref: news.mathworks.com comp.soft-sys.matlab:481515



"David " <dave@bigcompany.com> wrote in message
<g69pun$lo$1@fred.mathworks.com>...
> "ching l" <chinglnc@hotmail.com> wrote in message 
> <g69g1r$60c$1@fred.mathworks.com>...
> > "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)}{:});
> > 
> > 
> 
> start over... you are assigning 2 values of fixrand 
> without doing anything with the first one.  and your () 
> and {} don't match up in your wavplay function.  then what 
> are audio and fs?

sorry...it supposed to be 

[audio, fs] = wavread('G:\wyei.wav');
a{5} = {audio, fs};
 
fixrand= ceil(length(samples)*rand);
fixrand= randperm(5); 

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