Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Vectorizing data lookback?
Date: Wed, 3 Sep 2008 17:04:03 +0000 (UTC)
Organization: Lunds Universitet
Lines: 20
Message-ID: <g9mg23$ed4$1@fred.mathworks.com>
References: <g9db32$oq6$1@fred.mathworks.com> <g9gsna$qll$1@fred.mathworks.com> <g9maib$9di$1@fred.mathworks.com>
Reply-To: <HIDDEN>
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 1220461443 14756 172.30.248.37 (3 Sep 2008 17:04:03 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Wed, 3 Sep 2008 17:04:03 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 5707
Xref: news.mathworks.com comp.soft-sys.matlab:488442



"Nicholas "
<OtherPeopleTookAllTheGoodNames@deleteme.gmail.com> wrote in
message <g9maib$9di$1@fred.mathworks.com>...

> 
> Yes I do preallocate the vectors. I've tried to do
> everything I can to make the loop JIT compatible, but it's
> still too slow.

Maybe this FEX function for running extrema (max or min or
both) 

http://www.mathworks.com/matlabcentral/fileexchange/loadFile.do?objectId=18551&objectType=file

will help you speed up the code. Probably you will have to 
create a vector of the running max-values of the same length
as your input data.

hth
Lars