central_diff.m

Calculates numeric gradient using second-order difference formula for unevenly spaced data

Download
Download

You are now following this Submission

Editor's Note: This file was selected as MATLAB Central Pick of the Week

Cite As

Robert Canfield (2026). central_diff.m (https://au.mathworks.com/matlabcentral/fileexchange/12-central_diff-m), MATLAB Central File Exchange. Retrieved .

Acknowledgements

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

Categories

Find more on Interpolation in Help Center and MATLAB Answers

Tags

Add Tags

Add the first tag.

General Information

MATLAB Release Compatibility

  • Compatible with any release

Platform Compatibility

  • Windows
  • macOS
  • Linux
Version Published Release Notes Action
2.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.

Download
1.0.0

Download