How to replace findpeaks() with another function

조회 수: 39(최근 30일)
marcusbarnet
marcusbarnet 2018년 5월 20일
댓글: Star Strider 2018년 5월 21일
Hi to all,
I use findpeaks function in my code to calculate the four maximum values of a fft function.
I use it in this way:
[maxpeaks, idx] = findpeaks(10*log10(psdx),'MinPeakDistance',195,'NPeaks',4,'MinPeakHeight', -Inf, 'SortStr','descend')
The problem is that I need to run the code in a Matlab version which doesn't have the Signal Processing Toolbox. Is there any solution to write a similar function without the need of the SP Toolbox?
Thank you!

채택된 답변

sloppydisk
sloppydisk 2018년 5월 20일
편집: sloppydisk 2018년 5월 20일
Any of these options on the file exchange might help you.

추가 답변(1개)

Star Strider
Star Strider 2018년 5월 20일
If the MATLAB version is R2017b or later, the islocalmax (link) function is likely the best option.
  댓글 수: 2
Star Strider
Star Strider 2018년 5월 21일
Unfortunately, it won’t. It was introduced in R2017b.

댓글을 달려면 로그인하십시오.

Community Treasure Hunt

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

Start Hunting!

Translated by