I have a series of plots similar to the one below with multiple peaks and troughs. I want to get the values of the peaks and troughs and their x coordinate. The only way I can think to do it is to use max to find the value of the biggest peak, remove that section of data, find the next and so on. This is tedious and I have many to do. There must be a better way. Can someone show me what it is. Worksheet is attached.
Solved! Go to Solution.
Thanks for your reply, Valery. Probably my question was not clear. In addition to the value and position of the highest peak (and lowest trough), I want to get the maximum and minimum values of all the peaks and troughs (i.e., four of each in the example shown).
The better way is to use the FindPeaks function in Maple or the findpeaks function in Matlab.
Nothing in Mathcad will help you do that easily.
Well, the slope changes sign at each max or min. So if you calculate local slopes or derivatives you could step through and look for sign changes. This wouldn't work well with noisy data, but if your data is well behaved you might get ok results.
Nice. Unfortunately, I do not have the Data Analysis Extension Pack.
As far as I know the DAEP is part of every Mathcad distribution since MC14, apart from some single user edu licences, where the pack and its help is also installed during installation but the license for it is missing. In Prime its integrated anyway. Did you give it a try?
But in case you are using an older version of MC (from the pic you posted it looked like MC14 or MC15 anyway) or have a version without a license for the DAEP, its not hard to recode those functions. You will find examples how to do here in the forum, as an example