Path: news.mathworks.com!not-for-mail
From: "John D'Errico" <woodchips@rochester.rr.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Create a vector of derivatives, given a vector of values
Date: Thu, 16 Oct 2008 20:24:03 +0000 (UTC)
Organization: John D'Errico (1-3LEW5R)
Lines: 21
Message-ID: <gd87t3$8tl$1@fred.mathworks.com>
References: <gd6dfl$be8$1@fred.mathworks.com>
Reply-To: "John D'Errico" <woodchips@rochester.rr.com>
NNTP-Posting-Host: webapp-05-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1224188643 9141 172.30.248.35 (16 Oct 2008 20:24:03 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Thu, 16 Oct 2008 20:24:03 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 869215
Xref: news.mathworks.com comp.soft-sys.matlab:495695


"Johan " <robert.mchugh@ips.invensys.com> wrote in message <gd6dfl$be8$1@fred.mathworks.com>...
> Am looking for recommendations about how to create a vector of derivatives given a vector of values. 
> 
> In this case, I have an array with temperatures at different times (evenly spaced). I want to create an array of temperature derivatives.  (I anticipate losing a few points at the ends.) 
> 
> Could write a loop, I suppose, dT/dt_i = (T_i+1 - T_i)/dt
> But there are 20,000 points. 
> 
> Is there some vectorized scheme or existing function that I should look into? 
> 
> Thanks. 

Yes. Just look for a Savitsky-Golay tool. There
are many of them on the file exchange. Here
are a couple of them.

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

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

John