MATLAB: Creating matrix of maximum values (evaluating along time dimension) for each cell from multiple dimension matrix

matrixmaxmultidimensional

Given a matrix A ([long,lat,time], I need to create an array B [long,lat] where each cell in B is the maximum value from the corresponding cell that maximized the dimension time in A.

Best Answer

Doc max. It has option to find the maximum value along a prescribed dimension; max(A,[],dim). If your matrix is 3D max(A,[],3) shall work.