Have you a registration already ? Sign In
Addition Of Diagonal Elements Of A Matrix In MatLab®(Illustrated Expression)
In some cases, you need to the used maximum or minimum values of number series in mathematical calculations or data analyses in Matlab®. Matlab® provides a very useful command to index the maximum and minimum values of vectors and matrices inside it. In this article, we will show you how to index maximum and minimum values of matrices and vectors in Matlab®.
>> a = [263 62 626; 65 56 562; 5412 12621 26];
b = [263 62 626; 65 56 562; 5412 12621 26];
min(a)
max(a)
min(b)
max(b)
ans =
65 56 26
ans =
5412 12621 626
ans =
65 56 26
ans =
5412 12621 626
>>
We created the ‘a’ and ‘b’ vector and matrix as shown above to show you how to use max() and min() commands in Matlab®. Also, we calculated the maximum and minimum values of their matrix and vector as shown above.
As you can see that the maximum and minimum values of vector ‘a’ are calculated respectively.
Also, maximum and minimum values are calculated matrix ‘b’ respectively as shown above. As you can see the maximum and minimum value of each row of matrix ‘b’ is calculated with max() and min() commands in Matlab®.
Calculations of maximum and minimum values of vectors or matrices in Matlab® are very basic as you can see.
Do not forget to leave your comments and questions below about the use of the max() and min() commands in Matlab® below.
If you want further coding examples about the max() and min() commands in Matlab®, inform us in the comments.
This article is prepared for completely educative and informative purposes. Images used courtesy of Matlab®
Your precious feedbacks are very important to us.
Necessary cookies are absolutely essential for the website to function properly. This category only includes cookies that ensures basic functionalities and security features of the website. These cookies do not store any personal information.
Any cookies that may not be particularly necessary for the website to function and is used specifically to collect user personal data via analytics, ads, other embedded contents are termed as non-necessary cookies. It is mandatory to procure user consent prior to running these cookies on your website.
Write Comments