Save marked point on plot
이전 댓글 표시
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 !

채택된 답변
추가 답변 (1개)
Scott MacKenzie
2022년 3월 12일
편집: Scott MacKenzie
2022년 3월 12일
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
Anton Vernytsky
2022년 3월 12일
Scott MacKenzie
2022년 3월 12일
Could you also post the data file? Just click on the paperclick and select the file.
Anton Vernytsky
2022년 3월 12일
Scott MacKenzie
2022년 3월 12일
OK,thanks. I posted a solution as a separate answer.
카테고리
도움말 센터 및 File Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
