To find the maximum value in a vector, here is an example loop in MATLAB:
main.m287 chars11 lines
In this code block, we have a vector of values and we set the initial max value to be the first element of the vector. Then we loop through the rest of the elements and update the max value if we find an element greater than the current max value. Once we finish the loop, we have found the maximum value in the vector and can display it with the disp
function.
gistlibby LogSnag