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 14:18:02 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 64
Message-ID: <g6a2uq$s86$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>
Reply-To: "ching l" <chinglnc@hotmail.com>
NNTP-Posting-Host: webapp-05-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1216909082 28934 172.30.248.35 (24 Jul 2008 14:18:02 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Thu, 24 Jul 2008 14:18:02 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1438759
Xref: news.mathworks.com comp.soft-sys.matlab:481534



"David " <dave@bigcompany.com> wrote in message
<g6a0v2$rtq$1@fred.mathworks.com>...
> "ching l" <chinglnc@hotmail.com> wrote in message 
> <g69uif$nne$1@fred.mathworks.com>...
> > "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:
> > > > > 
1.> > > > >      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)}{:});
> > 
> 
> 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.