Hi,
I think the best way to do so has already been described here and here: basically there are two ways described there:
1- triangle thresholding
2- local maxima of curvature
i prefer the first one as i think it directly answer your question (the second one is for more spesific tasks)
time = x;
data = y;
x = [time(1) time(end)];
y = [data(1) data(end)];
m = ( y(2) - y(1) )/( x(2) - x(1) );
pm= - 1 / m;
figure();hold all
hP = plot(time,data,'b',x,y,'g',x(1),y(1), 'ro');grid on
yl = ( (m * time) + (m^2 * data) - (m * x(1)) + y(1) )/(1+m^2);
xl = T1 - m*(yl - data);
d2 = (xl - time).^2 + (yl - data).^2;
perpDist = d2;
[val_max, idx_max] = max(perpDist);
[val_min, idx_min] = min(perpDist(2:end-1));
[val_maxL, idx_maxL] = max(perpDist(1:idx_min));
plot(time,data,'b',time(idx_max),data(idx_max),'ro',time(idx_min),data(idx_min),'ro',time(idx_maxL),data(idx_maxL),'ro');grid on;hold all; plot(time,perpDist); hold off
I hope this answer your question (how accurate the point will depend on your massy data)
Best Answer