How to determine the start time and the end time of the signal
7 views (last 30 days)
Hi, I want to find the start time and the end time of the signal as shown in figure below.
I tried using "findchangepts" command to identify the both time but the x-axis is incorrect. Is someone know what is the reason?
In addition, I also not sure how accurate it is by using this method.
Is there any methods to find the time accurately?
Any advice would be appreciated.
Sam Chak on 16 Jun 2022
Alternatively, try this. The findchangepts function actually works.
T = readtable('https://www.mathworks.com/matlabcentral/answers/uploaded_files/1033920/signal.csv');
t = T.(1);
y = T.(2);
ipt = findchangepts(y, 'MaxNumChanges', 10);
Tstart = t(ipt(1))
Tfinal = t(ipt(end))
plot(Tstart, y(ipt(1)), 'ro', 'linewidth', 1.5, 'MarkerSize', 14)
plot(Tfinal, y(ipt(end)), 'ro', 'linewidth', 1.5, 'MarkerSize', 14)