How to find the maximum number in a column for each group of data that are not 0 in Matlab

I have a large table (17001 x 35), and for one column (the left one in this example), I need to get the largest value in each of the groups. So in this example, the answer would be 56.66, 317.18, and 138.28. The answer would ideally come in a new vector column just listed out. Any help? Seems so simple, but I am a newbie, so alas.

0 1 56.66 0 0 1 0 0 0 0 0 1 317.18 0 68.45 0 107.44 0 71.39 0 61.00 0 85.73 0 131.90 0 0 1 138.28 0 83.23 0 0 1 0 0 0 0



Read more here: https://stackoverflow.com/questions/66271264/how-to-find-the-maximum-number-in-a-column-for-each-group-of-data-that-are-not-0

Content Attribution

This content was originally published by smreeves at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: