How To Find Maximum Value Element of Matrix in MATLAB

In previous matlab tutorial post, we discussed about How to delete row/column in MATLAB with its matlab program.


Now in Post-21 of Module-01, we will discuss about how to find maximum value element of matrix in matlab, A matlab program for which has been shown in figure-1.

Figure.1 - MATLAB Program to find maximum value element of Matrix.

A matrix has been loaded into the matlab with the help of command written in line-3. While matrix has been displayed with the help of command written in line-4. A variable 'maxA' has been initialized with the help of command written in line-6 in which maximum value will be saved. With the help of two 'for loop' row and column of the matrix has been controlled individually.

Figure.2 - Command Window output to find maximum value element of matrix.

The value of each element of the matrix is compared with maxA with the help of command written in line-9 and the value of maxA has been replaced with the help of command written in line-10. After comparing of individual element of the matrix, maxA has been displayed on the command window with the help of command written in line-14 & line-15. Command window output of the above discussed program is shown in figure-2. MATLAB Program has been run by calling its name 'mod0121' on command window. After that a message 'Enter any Square Matrix' is displayed on the command window. When you type any matrix it display a message 'Maximum value element of Matrix is:' along with maximum value on the command window.

Brought to you By INFO4EEE (Website, Channel, and Classes).

2 comments:

  1. hello
    really thank you for sharing concepts in MATLAB
    It will be really great >
    hope to get more on MATLAB based knowledges

    thank you

    ReplyDelete
  2. Thanks Mr. Sapkota!!!

    For your feedback about post of MATLAB Module-I. Your feedback is very important to us. We will discuss basics about MATLAB simulink in Module-II, which will be started soon, Hence be in touch with us and also share it with your friends.

    Thanks for being with us.
    INFO4EEE

    ReplyDelete

Powered by Blogger.