Find maximum value of array within specified range, consecutively
Show older comments
I have a 3384x5 array of which the first and last 20 rows are shown in the pictures below.


Problem: I want to find the maximum value of column 3 within the specified range of column 2.
Problem example:
In the 2th column I have specified a range from 0.0 until 0.011.
Within this range of the 2th column I go to the 3th column. In the 3th column I search for the maximum value which corresponds to the value of the 2th column.
When the maximum value in the 3th column has been found with the corresponding value of the 2th column, than there will be a new range specified in the 2th column. The new range will be from 0.011 until 0.022, so the range increases with 0.011 every time.
Within the new range (0.011 until 0.022) I go again to the 3th column and search for the maximum value with the corresponding value of the 2th column
This loop continues until the last possible range in the 2th column is reached.
Result: All the maximum values found with the corresponding value of the 2th column have to be stored in a new array or matrix.
Until now I have not been able to solve this problem. Any solution and/or help would be very appreciated.
Accepted Answer
More Answers (1)
Steven Lord
on 22 Aug 2020
0 votes
Use the groupsummary function.
Categories
Find more on Logical in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!