what is the minimum of matrix a in matlab

You can use the min function in Matlab to find the minimum value of a matrix.

Here is an example for finding the minimum value of matrix A:

main.m
A = [1, 2, 3; 
     4, 5, 6; 
     7, 8, 9];

min_val = min(A(:)); % it will return 1 as it's the minimum value in matrix A
124 chars
6 lines

In the above example, we first defined a matrix A and then used the min function with the colon : operator to find the minimum value of all the elements in matrix A.

Note: min(A) will return the minimum value from each column of the matrix A. But using min(A(:)) will return the overall minimum value of the matrix.

Hope this helps!

related categories

gistlibby LogSnag