Code covered by the BSD License  

Highlights from
Local maxima and minima of a pp spline

4.5

4.5 | 2 ratings Rate this file 17 Downloads (last 30 days) File Size: 2.02 KB File ID: #26144

Local maxima and minima of a pp spline

by

 

18 Dec 2009 (Updated )

Determine the locations of local maxima and minima in a pp spline generated by pp = spline(x,Y);

| Watch this File

File Information
Description

This function uses vectorised methods to determine the locations of maxima and minima where they exist within a piecewise spline fit. The matlab built-in functions for determining the maxima and minima, by differentiating the pp spline and finding its zeros (using the Spline toolbox), are quite slow, and are given as comment at the end of the m-file for reference.

Required Products Spline Toolbox
MATLAB release MATLAB 7.7 (R2008b)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (4)
07 Mar 2011 Darik

Much faster than fnmin -- exactly what I was looking for. Thanks a lot!

09 Dec 2010 Matthew Arthington

Thomas Clark: Adjusted as suggested.

Actually I adjusted it a while ago, but I forgot to thank you - thanks.

02 Jul 2010 Thomas Clark

Ah!

Apologies - the code itself is actually spline toolbox independent - but the example code requires fnval, which can be directly replaced with ppval for non spline-toolbox users.

Suggest updating the example - I've updated my rating!

Cheers

Tom

02 Jul 2010 Tom Clark

The following link contains a short piece of code which makes this submission toolbox-independant (derivation of a pp).

http://orion.math.iastate.edu/alex/471/Examples/kincaid-cheney/matlab/ppder.m

Kind regards

Tom

Updates
03 Jul 2010

Altered the example code so that it is also toolbox independent.

Contact us