Path: news.mathworks.com!not-for-mail
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$1@fred.mathworks.com>
References: <icdpvj$hbc$1@fred.mathworks.com> <icdv3o$6ph$1@fred.mathworks.com> <icev2g$f2f$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1290472207 17128 172.30.248.37 (23 Nov 2010 00:30:07 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Tue, 23 Nov 2010 00:30:07 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1187260
Xref: news.mathworks.com comp.soft-sys.matlab:689124

"Roger Stafford" <ellieandrogerxyzzy@mindspring.com.invalid> wrote in message <icev2g$f2f$1@fred.mathworks.com>...
> "Steven_Lord" <slord@mathworks.com> wrote in message <icdv3o$6ph$1@fred.mathworks.com>...
> > "sivaprasad kunduru" <ku.sivaprasadreddy@gmail.com> wrote in message 
> > news:icdpvj$hbc$1@fred.mathworks.com...
> > > 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.
> > HELP RANDPERM.
>   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