From: Estee on 28 Jun 2010 15:25 Hi, I have an array of numbers, for example x = [1 2 3 4 5]. I want to find the (approximate) derivative for array x. On the MatLab site, a suggestion to approximate the derivative looks like this: y = diff(x); derivative = diff(y) ./ diff(x) However, since diff(array) shortens the length by 1, the top and bottom are of different sizes and causes an error. Does anyone know how to fix this, or know a better way to approximate derivatives of an array of numbers? Thanks! =] Estee
|
Pages: 1 Prev: boundary conditions for diffusion from a sphere Next: replace object properties |