You can use the max
function in MATLAB to return the maximum value in a table. If your table is a matrix, you can use the function on the whole matrix as follows:
main.m48 chars3 lines
In this example, the (:)
operator converts the matrix A
into a column vector, which then is searched for the maximum value. Finally, the maximum value is stored in the max_val
variable.
If your table is not a matrix, you can use the max
function with appropriate arguments to search along specific dimensions of the table. The documentation for the max
function has more information on this syntax.
gistlibby LogSnag