Column Calculus

Functions for interpolation, integration, and differentiation of column-major data, compatible with code generation.

https://github.com/geoffstanley/neutral-surfaces/tree/master/lib/columncalculus

You are now following this Submission

Simple functions for linear interpolation, PCHIP interpolation, PCHIP differentiation, and trapezoidal integration. Instructions are given to modify the code to evaluate higher derivatives and/or the integral of the PCHIP.
These functions efficiently work on every column of their inputs, and handle cases where an input has only one column (without internally expanding that variable). Each column is handled separately inside a for loop. This can be executed quickly by turning these functions into MEX functions via code generation -- although they are fairly fast in MATLAB R2015b and later owing to the JIT compiler.
These use a binary search to locate the grid points straddling the point and immediately evaluate the interpolant there, rather than pre-computing then evaluating the piecewise-polynomial interpolant for the full column (see "Piecewise Polynomial Calculus" for that).
interp1qn2 and pchipqn2 are slightly faster than callinginterp1qn or pchipqn twice, because only one binary search is done. (One could modify interp1qn and pchipqn to work on cat(3, Y, Z), but that concatenation can take longer than the actual interpolation.) Feel free to make interp1qn3...!
--- This package is no longer updated here. Instead, get updates from github:

Cite As

Geoff Stanley (2026). Column Calculus (https://nl.mathworks.com/matlabcentral/fileexchange/69713-column-calculus), MATLAB Central File Exchange. Retrieved .

Acknowledgements

Inspired: Piecewise Polynomial Calculus

General Information

MATLAB Release Compatibility

  • Compatible with any release

Platform Compatibility

  • Windows
  • macOS
  • Linux
Version Published Release Notes Action
1.1.1

Update Description. No changes to files.

1.1.0

minor speed and documentation updates.

1.0.0