Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: no repeat for rand
Date: Thu, 24 Jul 2008 14:28:01 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 41
Message-ID: <g6a3hh$6cu$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>
Reply-To: <HIDDEN>
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 1216909681 6558 172.30.248.38 (24 Jul 2008 14:28:01 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Thu, 24 Jul 2008 14:28:01 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 791003
Xref: news.mathworks.com comp.soft-sys.matlab:481537



"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 }.