central_diff.m

Calculates numeric gradient using second-order difference formula for unevenly spaced data
10,3K download
Aggiornato 1 ott 2015

Visualizza la licenza

Nota dell'editore: This file was selected as MATLAB Central Pick of the Week

The central_diff function calculates a numeric gradient using second-order accurate difference formula for evenly or unevenly spaced coordinate data. It operates in a similar fashion to the MATLAB function, gradient, except that it permits only one independent variable, x, and correctly handles unevenly spaced values of the x-coordinate data. Accuracy is increased at the ends relative to the MATLAB gradient function, which uses only first-order forward or backward differences at the ends, by instead using second-order forward difference at the left end and second-order backward difference at the right end.

Cita come

Robert Canfield (2024). central_diff.m (https://www.mathworks.com/matlabcentral/fileexchange/12-central_diff-m), MATLAB Central File Exchange. Recuperato .

Compatibilità della release di MATLAB
Creato con R2015b
Compatibile con qualsiasi release
Compatibilità della piattaforma
Windows macOS Linux
Categorie
Scopri di più su Interpolation in Help Center e MATLAB Answers
Tag Aggiungi tag
Riconoscimenti

Ispirato: central_diff2(y,deltat,d,a), DGradient

Community Treasure Hunt

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

Start Hunting!
Versione Pubblicato Note della release
2.0.0.0

Second-order accurate forward and backward difference formulae are used now at the left and right ends, instead of first-order forward/backward differences at the ends. Logical operators & and | were replaced with && and ||, respectively.

1.0.0.0