MATLAB: Max and min values in an array

matrixmaximummaximum in a matrix

thank you! Found the solution! Thank you!

Best Answer

See if this does what you want , first we split into 16 separate rows each and then we conquer in the third dimension:
[m,n]=size(A); % where A is your matrix of size 256 X 40K
parts = 16;
AA = permute(reshape(A.',n,m/parts,[]),[2,1,3]);
Max = max(AA,[],[1,2]); % max(max(AA)) for versions <= 2016b
[r,~]=find(AA == Max) % r represents rows