# Indexing The Biggest Or Lowest Value In A Matrix In MatLab(Illustrated Expression)

In some cases you need to calculate the biggest value of a matrix in Matlab. **The max() command and min() command **can calculate only the biggest values of each rows of a matrix in Matlab. In this article we sill show you how to calculate the biggest or the lowest values of a matrix in Matlab.

### How To Index The Biggest And The Lowest Element In A Matrix In Matlab?

Consider a situation that you want to index the biggest or the lowest value of the matrx ‘a’ as shown by red arrow above. You can calculate the whole row’s biggest and lowest values of matrix ‘a’ with min() and max() commands in Matlab.

What you need to do is, you need to recalculate the biggest or the lowest value of each row that calculated previously. Which can be done by typing ‘min(min(a))’ for the lowest value of matrix ‘a’ or ‘max(max(a))’ for the biggest value of matrix ‘a’ as shown by red box above.

So it is simple like that to calculate the biggest and the lowest value of matrices in Matlab.