Re: Findpeaks function
Andreas Weber <[email protected]>
| Newsgroups | gmane.comp.gnu.octave.general |
|---|---|
| Message-ID | <[email protected]> |
Am 24.02.21 um 18:28 schrieb Blaz: > The vector result1 should find local peaks (max values). Function > "findpeaks" rejects the inputs since they include negative values so I am > kind a stuck. you can either move the values like x = sin(0:0.1:10); [~, LOC] = findpeaks (x - min(x)) or remove the negative part x(x<0) = 0; > The vector result2 should give back index of crossing of x and y, where > these are zero (or close to zero). On the chart you can see that not all > crossings of x and y fullfill this condition. I don't understand this, perhaps you should also upload the data and show some code what you already did. You might also find "peakdet" interesting https://github.com/gnu-octave/macgyver_utils/blob/master/peakdet.cc -- Andy