Code covered by the BSD License  

Highlights from
nanderivative.m v2.1 (Jul 2009)

Be the first to rate this file! 0 Downloads (last 30 days) File Size: 3.94 KB File ID: #21187
image thumbnail

nanderivative.m v2.1 (Jul 2009)

by Carlos Adrian Vargas Aguilera

 

22 Aug 2008 (Updated 29 Jul 2009)

N-order derivative of vector data by interpolating nearby points, ignoring NaNs.

| Watch this File

File Information
Description

This program estimates the N-order (1rst derivative by default) derivative of a vector data Y (or the columns of a matrix) by interpolating, using INTERP1, two nearby points at each argument point X and then calculating their slope. It ignores NaNs elements.

>> dYdX = nanderivative(Y,X);

The N-order, the proximity of the interpolating points and the interpolation method (default 'spline') are optional input arguments.

Any comment will be very appreciated. (check the screenshot for an example)

Acknowledgements
This submission has inspired the following:
der.m v1.0 (Nov, 2009)
MATLAB release MATLAB 7.7 (R2008b)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Please login to add a comment or rating.
Updates
08 Jun 2009

Rewritten code. Mayor changes with inputs and link axes. Fixed bugs with floating point error, monotonically increasing/decreasing X and if N is not 1 do not outputs all other derivatives anymore.

29 Jul 2009

v2.1 Fixed small bug with INTERP1.

Tag Activity for this File
Tag Applied By Date/Time
approximation Carlos Adrian Vargas Aguilera 22 Oct 2008 10:15:38
interpolation Carlos Adrian Vargas Aguilera 22 Oct 2008 10:15:38
diff Carlos Adrian Vargas Aguilera 22 Oct 2008 10:15:38
gradient Carlos Adrian Vargas Aguilera 22 Oct 2008 10:15:38
derivative Carlos Adrian Vargas Aguilera 22 Oct 2008 10:15:38
nan Carlos Adrian Vargas Aguilera 22 Oct 2008 10:15:38
slope Carlos Adrian Vargas Aguilera 22 Oct 2008 10:15:38
spline Carlos Adrian Vargas Aguilera 22 Oct 2008 10:15:38
cubic Carlos Adrian Vargas Aguilera 22 Oct 2008 10:15:38
linear Carlos Adrian Vargas Aguilera 22 Oct 2008 10:15:38
interp1 Carlos Adrian Vargas Aguilera 22 Oct 2008 10:15:38
derivative John Deas 21 Jan 2009 08:16:00
derivative Mark 07 Jul 2010 08:46:17

Contact us at files@mathworks.com