MATLAB: Derivative of the right heel marker signal

homework

In attachment are the data of the right heel. The right heel was followed by several camera's and gave the following data of its position. I want to know something about the velocity of the heel, so I need to take the derivative. How do I do this? Do I need to know the time of the movement? (in attachment is also the plot of the right heel).

Best Answer

I always use the gradient function to calculate numerical derivatives:
d = matfile('Sam_RHEE.mat');
RH = d.RHEE; % Data Vector (Right Heel)
T = 0:size(RH)-1; % Time Vector
dRH = gradient(RH,T); % Derivative (w.r.t. T, ‘T’ not required)
figure(1)
plot(T, RH)
hold on
plot(T, dRH*100)
hold off
grid
I calculate the numerical derivative with respect to a time vector if possible, and since you may have a time base, I created and included one here. The time vector is not necessary to use the gradient function.
In the plot, I multiplied the derivative, ‘dRH’ by 100 to make it more visible. I renamed your .mat file so I can keep track of it (among all the others I download here).
Related Question