We won't take an actual limit, so what we can do is imagine that we have created a domain vector x for which the values are very close together,
e.g. x=linspace(0,1,1000)=[0 0.0010 0.0020 ... ].
Since these entries are close together, we can model the points $(x, f(x))$ and $(x + h, f(x+h))$ in Matlab as the vector terms $(x(k),y(k))$ and $(x(k+1),y(k+1))$.
Consequently, we will say
$\frac{dy}{dx} = \lim_{h \to 0} \frac{f(x+h) - f(x)}{(x+h)-x}$
$\approx \frac{y(k+1) - y(k)}{x(k+1) - x(k)}$
$= \frac{\text{change in consecutive y vector terms}}{\text{change in consecutive x vector terms}}$.
In other words, if x=linspace(0,1,1000), then "h" = 1 (hint: the step size...)
On this page and the next, we will look at numerical differentiation. We will approach this using two commands
$\bullet$ diff(v): computes the differences between consecutive terms in the vector v
$\bullet$ gradient: similar, but adjusts it so that the newly created vectors have the same length as the original