Find duration of signal
12 Ansichten (letzte 30 Tage)
I have a set of signals that due to some unknown error have been acquired with millions of empty datapoints. Is there a way I can automatically detect the moment the signal ends so I can delete everything from that point onwards?
Weitere Antworten (1)
Steven Lord am 9 Sep. 2020
If the empty data points are represented by NaN then find the 'last' 1 element of the vector that isfinite.
x = [1:10 NaN(1, 5)]
find(isfinite(x), 1, 'last')
If the vector has no missing data inside it, you could instead just rmmissing.