Save marked point on plot
Ältere Kommentare anzeigen
Hello,
I would like to save the the x and y values of the marked point on the plot.
Can someone explain me please how to write a code or what functions can i use.
Thank you !

Akzeptierte Antwort
Weitere Antworten (1)
Scott MacKenzie
am 12 Mär. 2022
Bearbeitet: Scott MacKenzie
am 12 Mär. 2022
Since you haven't provided any data or code, this is a rough answer only:
[pks, locn] = findpeaks(-y, 'MinPeakProminence', 0.1);
Using -y will give you the valleys, which is what you are after. You'll need to play with the peak prominence value to the get the valleys you want and exclude those you don't want. Then, you need to take the negative of pks to get the actual y values of the valleys. You can use locn to retrieve the corresponding x values.
4 Kommentare
Anton Vernytsky
am 12 Mär. 2022
Scott MacKenzie
am 12 Mär. 2022
Could you also post the data file? Just click on the paperclick and select the file.
Anton Vernytsky
am 12 Mär. 2022
Scott MacKenzie
am 12 Mär. 2022
OK,thanks. I posted a solution as a separate answer.
Kategorien
Mehr zu 2-D and 3-D Plots finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
