matlab matrix operations overloaded to compute first and second derivatives