x as column or row vector, more than 2 values
y as column or row vector, same amount of values as for x
dy1: 1st derivative, y’(x)
dy2: 2nd derivative, y”(x)
The first dy2 at x(1) and the last dy2 at x(end) don't exist and are set to NaN
x1c and dy1c return the exact 1st derivative y’(x1c) at the line segment centers.
x2c and dy2c return the 2nd derivative y”(x2c) at the center of line segment pairs.
The result is in general not as good as y”(x) is.
If x or y is a row vector, all outputs are returned as row vectors.
On error NaN is returned for all outputs.
1.4 Syntax examples
For 1st derivative:
For 2nd derivative:
For more accurate 1st derivative:
A demonstration GUI is included.