Be the first to rate this file! 10 downloads (last 30 days) File Size: 3.94 KB File ID: #21187

nanderivative.m v2.1 (Jul 2009)

by Carlos Adrian Vargas Aguilera

 

22 Aug 2008 (Updated 29 Jul 2009)

Code covered by the BSD License  

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

Download Now | 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)
Zip File Content  
Other Files license.txt,
nanderivative.m
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
 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com