How to find the minimum values in chunks of each column in a large matrix

1 view (last 30 days)
I have a large matrix with 10s of columns and 100s of rows. I essentially want to find the minimum value of each column in four parts. I want to take those values and put them into a matrix with four columns containing the four minimum values from each column of the original matrix. Can anyone give me some insight on getting this started?

Accepted Answer

Walter Roberson
Walter Roberson on 7 Aug 2015
squeeze(min(reshape(YourMatrix, size(YourMatrix,1)/4, 4, size(YourMatrix,2)))
If your matrix does not have a multiple of 4 for rows or you do not want the division to be equal, then more work would have to be done.
  1 Comment
Anthony Padilla
Anthony Padilla on 7 Aug 2015
The number of rows is 359 in each case, so the 4 sections will not be equal. I want it to find the minimum from rows 1-91, 92-180, 181-270, and 271-359.

Sign in to comment.

More Answers (0)

Categories

Find more on Multidimensional Arrays 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!