Simple, do the same but with max() instead of min(). If you use max to find the maxima in the columns of the matrix, it returns the row indices. But rather use the third input if you're not sure. what i want is to find the maximum value in each odd column (i mean in columns 1, 3,5,and so on), and then to return to me, the maximum value of that column in addition to the corresponding row. i have had the cell matrix attached to this post. If A is a matrix, then max(A) is a row vector containing the maximum value of each column. Finding maximum and its index of the row that contains the max value in a cell array in matlab. The associated column number is 4, as per followings: octave:72> = min(min(A,1)) The max function how you used it works like. The associated row number is 2, as per followings: octave:76> = min(min(A,2)) To find the associated row and column programmatically, just simply do this. (Note: the assiciated location is row 2, column 4 - if you scan through the matrix manually). The minimum value may be found easily by doing this: octave:71> min(min(A)) Say we have a Matrix A that look like this: octave:69> A = rand(3,4) 3 If A is a multidimensional array, then max (A) operates along the first array dimension whose size does not equal 1, treating the elements as vectors. 2 If A is a matrix, then max (A) is a row vector containing the maximum value of each column. But if you want to find corresponding time value for max velocity, first you need to find index of it. MaxVelocity max (Y) This will imply the peak value of your velocity profile. Note that Octave index start from 1 (instead of 0). Description 1 If A is a vector, then max (A) returns the maximum of A. In order to find the maximum value, you need to employ some MATLAB functions (max and find). This article summarises my solution to this problem (which, hopefully this will also come in hadny to you!). Given a Matrix A with m rows, and n columns find the mininum (or maximum) value and the associated row and column number Whilst working through the many (Octave) coding assignment from Andrew Ng's Stanford Machine Learning course, a common problem that I have to solve revolves around this: