Find duration of signal
Mostrar comentarios más antiguos
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?
Thanks everyone.

4 comentarios
Xavier
el 9 de Sept. de 2020
Can you upload a copy of the raw data?
Marc Elmeua
el 9 de Sept. de 2020
Star Strider
el 9 de Sept. de 2020
There are no actual ‘missing’ values, just a very low amplitude signal after about element 40:
T1 = readtable('sampledata.csv');
figure
semilogy(abs(T1{:,1}))
grid
producing:

That would appear to be legitimate data.
.
Xavier
el 10 de Sept. de 2020
This depends on how you define legitimate data, if you unplug a probe/sensor from an oscilloscope it will continue to display numbers and a waveform. If you're trying to measure a signal then it is fair to call recorded noise invalid data
Respuesta aceptada
Más respuestas (1)
Steven Lord
el 9 de Sept. de 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.
rmmissing(x)
1 comentario
Marc Elmeua
el 9 de Sept. de 2020
Categorías
Más información sobre Logical en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

