From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Coding
Date: Tue, 23 Nov 2010 00:30:07 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 14
Message-ID: <icf1uf$gn8$>
References: <icdpvj$hbc$> <icdv3o$6ph$> <icev2g$f2f$>
Reply-To: <HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: 1290472207 17128 (23 Nov 2010 00:30:07 GMT)
NNTP-Posting-Date: Tue, 23 Nov 2010 00:30:07 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1187260
Xref: comp.soft-sys.matlab:689124

"Roger Stafford" <> wrote in message <icev2g$f2f$>...
> "Steven_Lord" <> wrote in message <icdv3o$6ph$>...
> > "sivaprasad kunduru" <> wrote in message 
> > news:icdpvj$hbc$
> > > I am having a binary vector a=[1,0,1,1,0,1,0,1,0,0,0,1,.....];
> > > I want to sort this vector randomly,In other words I want to generate 
> > > interleaver.
> > > Can any one help me in this aspect.
>   The following code uses the same number of calls on 'rand' and requires many more lines of code, and yet is only of order n.  Presumably there there must be a value of n beyond which this method would be faster, but I don't know at the moment what that number might be.
- - - - - - -
  Based on a few trial runs on my computer the break-even value of n would have to be very large indeed, so you should probably stick with Steven's 'randperm' method, Sivaprasad.  Just regard the method I exhibited as something of theoretical interest.

Roger Stafford