Difference Matrices for ODE and PDE