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: Fri, 25 Jul 2008 21:14:02 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 48
Message-ID: <g6dfmq$hgd$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> <g69uif$nne$1@fred.mathworks.com> <g6a0v2$rtq$1@fred.mathworks.com> <g6a2uq$s86$1@fred.mathworks.com> <g6a3hh$6cu$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 1217020442 17933 172.30.248.37 (25 Jul 2008 21:14:02 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Fri, 25 Jul 2008 21:14:02 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1438759
Xref: news.mathworks.com comp.soft-sys.matlab:481900



"David " <dave@bigcompany.com> wrote in message
<g6a3hh$6cu$1@fred.mathworks.com>...
> "ching l" <chinglnc@hotmail.com> wrote in message 
> <g6a2uq$s86$1@fred.mathworks.com>...
> 
> > > > [audio, fs] = wavread('G:\wyei.wav');
> > > > a{5} = {audio, fs};
> > > >  
> > > > fixrand= ceil(length(samples)*rand);
> > > > fixrand= randperm(5); 
> > > > 
> > > > wavplay(a{fixrand)}{:});
> > > > 
> > > 
> > > thats one step better... but you still have 2 
> assignments 
> > > to fixrand without using the first one, and the () and 
> {} 
> > > in the wavplay don't match up.
> > 
> > sorry, I definitely not a bright person, I need a bit
> > explanation of this please
> > 
> > 1.you still have 2 assignments to fixrand without using 
> the
> > first one
> > 
> > 2. ) and {} in the wavplay don't match up.
> 
> you have these two steps... you assign a value to fixrand, 
> then you assign another value to it, so the first one is 
> lost.  why do the first one??
> 
> fixrand= ceil(length(samples)*rand);
> fixrand= randperm(5); 
> 
> in this statement remove the text and just leave the () 
> and {}:
> wavplay(a{fixrand)}{:});
> and you get:
> ({)}{})
> note that you have ({ then a ) without closing the }.
> 

Did you mean like this?

fixrand= randperm(5);
wavplay({)}{});