Finding x value for given y in a zig-zag data.

I have a data which oscillates around x-axis. How can I get x values for a given y value. I can get as many, I will sort the one required.
Thank you.

 Respuesta aceptada

Star Strider
Star Strider el 29 de Ag. de 2020

0 votos

Use findpeaks (with the original and negative of your data), or islocalmax and islocalmin, to get the peaks and valleys, then for each of those segments, use interp1 to get the x-values for a y-value in each segment.
This obviously requires a loop. There is no alternative.

Más respuestas (0)

Productos

Versión

R2020a

Etiquetas

Preguntada:

el 29 de Ag. de 2020

Respondida:

el 29 de Ag. de 2020

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by