How can I find the peak values of a curve?
조회 수: 42(최근 30일)
So I have these curves which have several peaks. Can anyone please tell me how can I detect the peaks and put a value to those points? The attached picture is manually created -
Any feedback from you will be highly appreciated! Thank you!
Abderrahim. B 2022년 8월 31일
Use findpeaks for each curve. Put findpeaks function in a for loop together with the plot function.
randData = randi(10, 10, 5) ;
for ii = 1: length(randData(1,:))
Hope this helps
Cris LaPierre 2022년 8월 31일
If you are using a live script, I suggest using the Find Local Extrema task. You can see an introduction to this tool in this recent live stream. It will allow you to interactively find the right settings to identify your peaks. If you prefer to do it programmatically, look into the findpeaks function.
Once you have the indices of the peaks, you can use the text function to label them in your plot.