Path: news.mathworks.com!not-for-mail
From: "John D'Errico" <woodchips@rochester.rr.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Randomization_same number
Date: Fri, 6 Nov 2009 23:04:01 +0000 (UTC)
Organization: John D'Errico (1-3LEW5R)
Lines: 17
Message-ID: <hd2a11$974$1@fred.mathworks.com>
References: <hd249a$im2$1@fred.mathworks.com> <hd265a$e8e$1@fred.mathworks.com> <hd26rr$q78$1@fred.mathworks.com>
Reply-To: "John D'Errico" <woodchips@rochester.rr.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 1257548641 9444 172.30.248.37 (6 Nov 2009 23:04:01 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Fri, 6 Nov 2009 23:04:01 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 869215
Xref: news.mathworks.com comp.soft-sys.matlab:583149


"Kostas " <eclipse_dsotm@hotmail.com> wrote in message <hd26rr$q78$1@fred.mathworks.com>...
> >BUild the 120 element vector in a sorted order than use "randperm"
> >
> >The "randperm" will help you, but you need to postprocess the data to change duplicate >values on a single row. A swap should be good.
> >
> >http://www.advancedmcode.org/
> 
> 
> Thanks for your reply. I think I should have mentioned that I must generate this vector a lot of times in the future, so it must me always different. :)
> 
> Thanks again

So? Then be efficient in your code. Randperm is
fast. It takes little effort to test to see if elements
are consecutive. Use diff to do the test.

John