How does Matlab or computer algebra systems find derivatives of functions?

Is it correct that they use a matrix transformation?

-

On the other hand you might have e.g. a collection of pairs $(x_i,y_i)$ of numerical values corresponding to evaluations of some function $y=f(x)$ at points $x_i$, i.e. $y_i=f(x_i)$. Then there are various algorithmic procedures to create a new sequence, which approximates evaluations of the derivative of $f$. This is a subject of numerical analysis. As you mention, one way is to use the so called "difference matrix". If you look at the documentation of the function you are using, there should be reference to which method of differentiation is employed (MATLAB has very good documentation).