gradient

Core Math

Numerical gradient using central differences. Interior points use central differences; edges use forward/backward differences. h is optional uniform spacing (default 1).

Syntax

gradient(F)
gradient(F, h)

Examples

gradient([1, 4, 9, 16])
▶ Run
gradient(F, 0.1)
▶ Run

See Also

Try SimLab — Free MATLAB® Alternative

466 functions. Runs in your browser. No install.

Open SimLab

Stay Updated

Get notified about new simulations and tools. We send 1-2 emails per month.