Path: news.mathworks.com!not-for-mail
From: "Jayveer " <jveer@jveer.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: please help optimize this ('find' is too slow)
Date: Fri, 5 Dec 2008 02:00:20 +0000 (UTC)
Organization: University of Manchester
Lines: 16
Message-ID: <gha1vj$850$1@fred.mathworks.com>
References: <gh46f4$pg2$1@fred.mathworks.com> <gh7ror$eno$1@fred.mathworks.com> <gh7vs8$fgq$1@fred.mathworks.com> <gh9faq$fb4$1@fred.mathworks.com> <gh9qmi$l5c$1@fred.mathworks.com> <gh9ske$6he$1@fred.mathworks.com>
Reply-To: "Jayveer " <jveer@jveer.com>
NNTP-Posting-Host: webapp-03-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1228442420 8352 172.30.248.38 (5 Dec 2008 02:00:20 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Fri, 5 Dec 2008 02:00:20 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1206797
Xref: news.mathworks.com comp.soft-sys.matlab:505101

lol, so silly of me! you are right! :) thanks loads dude! the processing time went down from 28s to 13s!

however, considering right now i have a simulation running which initially said '10Hrs remaining', 13s is still quite slow coz the function is called 600k+ depending on the model being simulated. 

you seem to have a pretty good understanding of code optimisation. have you got any more ideas how to make this even faster? i'm trying to bring this down to sort of 5s ish for this particular sample data.

this one appears to be the slowest one now -takes 6.7s out of 13s

        ny=nx(P(2,nx)>=min(NCy(c,:))&P(2,nx)<max(NCy(c,:)));

any ideas?