sl_diff

Core Math

Differences between adjacent elements. Returns an array of length n-1 where result[i] = x[i+1] - x[i].

Syntax

sl_diff(x)

Examples

sl_diff([1, 3, 6, 10])
▶ Run
sl_diff([0, 1, 4, 9, 16])
▶ 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.