I have a large table of data that looks like this:
The "is a peak" and "is a trough" columns have been programmed to check if the value in the "P/dBm" is a local maximum or minimum. So in the case of the final row, the value is a peak because it is greater than the six above it and the six below it.
In the "modulation index" column I need to examine the "is a peak" element of that row, and if the value is a peak calculate a value based on that row's "P/dBm" value and the next peak's "P/dBm".
In short: how can I scan the "is a peak" column, detect the TRUE elements, and where there is a TRUE element perform some function depending on the next TRUE element down?
Sorry if that's difficult to understand...

The "is a peak" and "is a trough" columns have been programmed to check if the value in the "P/dBm" is a local maximum or minimum. So in the case of the final row, the value is a peak because it is greater than the six above it and the six below it.
In the "modulation index" column I need to examine the "is a peak" element of that row, and if the value is a peak calculate a value based on that row's "P/dBm" value and the next peak's "P/dBm".
In short: how can I scan the "is a peak" column, detect the TRUE elements, and where there is a TRUE element perform some function depending on the next TRUE element down?
Sorry if that's difficult to understand...

Last edited: