Hi there,
I'm trying the create something that looks like this
Based on my data (the top subplot) I've managed to get the peaks (bottom subplot) using the following code
time_tot = d(:,1); displacement= d(:,2); [Maxima,MaxIdx] = findpeaks(displacement);time_max = time_tot([MaxIdx])i=i+1 ;figure(i)hold onsubplot(2,1,1)plot(time_tot,displacement)subplot(2,1,2)plot(time_max,Maxima)hold off
However, I'm not sure how to get the troughs. If anyone could help with this problem, then I would be greatly appreciative.
Best regards,
Lloyd
Best Answer