Smoooth and Differentiate

A function that smoothes and calculates the first derivative of a two column matrix input data.
334 Downloads
Aktualisiert 27. Jan 2012

Lizenz anzeigen

% function ynew=smoothdiff(dados,xnew,sdx,q,nmin)
%
% This function smoothes and differentiates a sequence of numbers based on
% an algorithm similar to Savistky and Golay. There are no restrictions
% however, on the number of points or on their spacing.
% This function also calculates the first derivative at the xnew points
%
% INPUT:
% dados - data in a two column matrix (first column x; second column y)
% xnew - is a vector where new ordinates are to be computed
%
% sdx - is the range of data to be used in the interpolation
% nmin - is the minimum data points to be used in the interpolation.
% q - is the degree of the polynomial to be used in the interpolation
%
% ALGORITHM:
% For each point xi of the xnew vector, this function finds the least
% squares polynomial passing through the experimental points lying between
% [xi-sdx, xi+sdx].
% Using this polynomial it calculates, with polyval, new values for the
% function and its derivative in that same interpolating window.
% All calculated values for each abscissa are used to compute an average
% value of the smoothed function and its derivative.
% When sdx range includes fewer points than nmin, the range is enlarged to
% include at least nmin points. This may occur more often at the edges
% of the data.
% Note that we should have nmin>q
%
% OUTPUT (ynew - 5 column matrix)
% column 1- new abscissas
% column 2- new ordinates
% column 3- their standard error
% column 4- first derivative
% column 5- no. of values that were calculated for the ith point
%

Zitieren als

Carlos J. Dias (2024). Smoooth and Differentiate (https://www.mathworks.com/matlabcentral/fileexchange/34772-smoooth-and-differentiate), MATLAB Central File Exchange. Abgerufen .

Kompatibilität der MATLAB-Version
Erstellt mit R2010b
Kompatibel mit allen Versionen
Plattform-Kompatibilität
Windows macOS Linux
Kategorien
Mehr zu Interpolation finden Sie in Help Center und MATLAB Answers

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Veröffentlicht Versionshinweise
1.7.0.0

Improved description of the function

1.6.0.0

The description has been corrected.

1.3.0.0

The description of the function was corrected.

1.2.0.0

The description of the function was corrected.

1.0.0.0