MATLAB: Finding maximum in a matrix

matrix manipulation

Suppose I have 1000×1 matrix and my data is from (50,60) and then from (160,170) and so on (i.e randomly distributed), What I want is to find maximum out of this 50 to 60 location and then maximum from 160 to 170 location and so on. How to find this ?

Best Answer

  • Suppose mat is 1000x1 matrix
    %this will give the maximum value within the matrix uptp 50 rows and 60 colm
    mat1=mat(1:50,1:60);
    max1=max(mat1(:));
    You can do the same form other also
    mat2=mat(1:160,1:170);
    max2=max(mat2(:));
    Is this you are looking for?