View License

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

Highlights from
fitting decaying oscillations

Be the first to rate this file! 4 Downloads (last 30 days) File Size: 2.31 KB File ID: #34971 Version: 1.4

fitting decaying oscillations



07 Feb 2012 (Updated )

From inputs t, y the best fit to the decaying oscillation is determined.

| Watch this File

File Information

 [A, T1, T2, phase, offset, Ssq] = fit_decay_oscillations( t, y, options )
 fitting decaying oscillations of the form
 y(t) = A exp( -t/T1 ) cos( t / T2 + phi) + offset
 where A is the amplitude, T1 is the decay time, T2 is the period, along with
 phase and offest. Ssq is the sum of residuals.
 options are 'notify' to show progress and 'plot' to give a plot
 you can also supply a guess or series of guesses via a row vector or
 matrix, m, where size( m, 2 ) = 5;
 if you just run program without arguments it will do an example
 examples are
 fit_decay_oscillations( t, y, 'notify', 'plot')
 [A, T1, T2, phase, offset] = fit_decay_oscillations( t, y, [1 2 3 4 5])
 Note: this script uses LMFnlsq from MATLAB central file exchange 2/5/12

MATLAB release MATLAB 6.0 (R12)
Other requirements you will need to download the function LMFnlsq from file exchange
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
08 Feb 2012 1.1

bug fix

08 Feb 2012 1.2

used the Jacobian matrix to speed calculations.

09 Feb 2012 1.3

speed improvement, and fixed calculation of Jacobian

09 Feb 2012 1.4

another bug fix

Contact us