Path: news.mathworks.com!not-for-mail
From: "Jonny O'Connell" <jonnydotoconnelldotx@gmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Vectorization Help...I think
Date: Sat, 17 Jul 2010 22:14:04 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 15
Message-ID: <i1t9vc$k9s$1@fred.mathworks.com>
References: <i1sreb$6fs$1@fred.mathworks.com> <i1suli$mtn$1@fred.mathworks.com>
Reply-To: "Jonny O'Connell" <jonnydotoconnelldotx@gmail.com>
NNTP-Posting-Host: webapp-05-blr.mathworks.com
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1279404844 20796 172.30.248.35 (17 Jul 2010 22:14:04 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Sat, 17 Jul 2010 22:14:04 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 2413904
Xref: news.mathworks.com comp.soft-sys.matlab:653939

> Try this:
> 
> [trash loc] = ismember(secondParent,firstParent);
> while cycleIndex ~= seedNumber;
>     cycleIndex = loc(cycleIndex);
>     offspring(cycleIndex) = firstParent(cycleIndex);
> end
> 
> Bruno

Thank-you! I think you accidentally missed the stopping condition, but after adding that back in I did a quick test. For the whole loop originally, 320 seconds, with your alteration, the loop and the ismember line are only 145....over twice as quick!

Many thanks again,

Jonny