Find only peaks of interest
조회 수: 1 (최근 30일)
이전 댓글 표시
I need to pick only the periodic peaks. Meaning I want peaks only in the circled region (because they are periodic) or other regions where the peaks are periodic. I don't want to pick any other peaks especially the ones with larger transtions. Can someone help me with this.
댓글 수: 0
답변 (1개)
Star Strider
2019년 5월 9일
Your best option is to use two separate calls to findpeaks with different 'MinPeakHeight' arguments for each. The first one would not have a 'MinPeakHeight' argument at all, and the second would be 0. Then use the setdiff function to retrieve the locations you want.
Example —
locs1 = 1:10; % All Peaks
locs2 = [1:3 7:10]; % Peaks With ‘'MinPeakHeight',0’
locsWanted = setdiff(locs1, locs2); % Desired Peaks
Once you have the ‘locs’, (here ‘locsWanted’)getting the peaks and whatever the independent variable values are for those peaks is just indexing into the various vectors using ‘locsWanted’ as the index. .
댓글 수: 0
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!