How to extract data from a plot (figure)

2 visualizaciones (últimos 30 días)
Gustavo Araujo
Gustavo Araujo el 8 de En. de 2021
Comentada: Mathieu NOE el 11 de En. de 2021
Hello!
I am trying to extract the data in my figure, when it gets "true" or "false". For example, the image below has a true at 0.4159 and a false at 0.9795. How can I extract this (can be through a script) to get these point all over the plot?
Thank you in advance!
  5 comentarios
Gustavo Araujo
Gustavo Araujo el 8 de En. de 2021
Thank you a lot! It worked on what I'm working on!
If I want to place the t0_neg and t0_pos inside another function, what's the right way to do this?
Mathieu NOE
Mathieu NOE el 11 de En. de 2021
hello Gustavo
glad it meets your needs
you can create your own function that use's the crossing function I sent you (call it inside your own function and pass the arguments).

Iniciar sesión para comentar.

Respuestas (1)

Cris LaPierre
Cris LaPierre el 8 de En. de 2021
You would process the data used to create the plot, not the plot itself. Look at your plot and see if you can identify some characteristic you could use to detect when the signal switches to true and when it switches to false.
I would probably try something using diff(Fault.signals.values), since a change of +1 indicates a switch from False to True, while a change of -1 indicates a switch from True to False.
See this answers post as well.

Community Treasure Hunt

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

Start Hunting!

Translated by