find minimum of list in matlab

To find the minimum value of a list/vector in Matlab, you can use the built-in min function. The syntax of the min function is as follows:

main.m
minVal = min(vector)
21 chars
2 lines

Here, vector refers to the list for which you want to find the minimum value, and minVal is the minimum value of the list.

For example, let's say you have the following list:

main.m
myList = [2, 7, 4, 8, 1, 9, 3];
32 chars
2 lines

To find the minimum value in this list, you can use the min function as follows:

main.m
minVal = min(myList);
22 chars
2 lines

This will return the value 1, which is the minimum value in the list myList.

gistlibby LogSnag