Exclude last sample as peak despite being the maximum
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Hg
el 20 de Oct. de 2015
Comentada: Star Strider
el 20 de Oct. de 2015
The first sample is excluded despite being the maximum in findpeaks(). How to exclude the last peak?
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/150629/image.png)
1 comentario
Adam
el 20 de Oct. de 2015
Assuming you mean the peak that comes with the final sample can't you just delete the last peak from the list of peaks that get found? It may need a test to check the peak location is equal to the last index as it may be a trough instead in some cases, but that depends on your data.
Respuesta aceptada
Star Strider
el 20 de Oct. de 2015
The findpeaks function has a number of name-value pair arguments you can use. For example, if you only want one peak (the first one that meets other criteria you may set), set 'NPeaks',1 in the argument list. Others you can set that might do what you want are 'MinPeakDistance' and 'Threshold'.
2 comentarios
Star Strider
el 20 de Oct. de 2015
I would probably use these two arguments: 'MinPeakDistance',100,'NPeaks',1. You will have to experiment to get the result you want. Without your data, it is not possible to provide exact code.
Más respuestas (0)
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!