Interval where values are greater than treshold
Mostrar comentarios más antiguos
Hi everyone
Logic = Data > Treshold
I now need to know what the intervals are where the treshold is exceeded
Logic = [1 1 1 0 0 0 1 1 0 1]
Desired_Output = [1 3;7 8;10 10]
So - from 1 to 3, from 7 to 8 aswell as 10
I can't think of a good way to do this.
Thank in advance
Respuesta aceptada
Más respuestas (1)
Jeremy
el 10 de Dic. de 2019
I believe you are looking for the find command.
find(Logic)
3 comentarios
Lucas Russi
el 10 de Dic. de 2019
Jeremy
el 10 de Dic. de 2019
You could use
diff
to determine adjacent numbers and drop the intermediate numbers appropriately
Lucas Russi
el 10 de Dic. de 2019
Categorías
Más información sobre Communications Toolbox 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!