I need to obtain second derivativ Second derivative

I have a set of data as follows.
How can I calculate the second derivative of the curve obtained from these data.
x=[0.1;0.07;0.05;0.03;0];
r=[-98.9407;-105.7183;-111.2423;-116.0320;-120.0462];

Answers (1)

y=gradient(gradient(r,x),x)
or
r1=diff(r)./diff(x)
r2=diff(r1)./diff(x(2:end))

Categories

Asked:

on 17 Jul 2016

Edited:

on 17 Jul 2016

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!