MATLAB: Problem with min function when finding minimum value

minimum

I am trying to find the minimum value in a vector of type double by using min function.It is showing the error as Index exceeds matrix dimensions . Ex:I have a vector named min_values of size 1*200 with double values..I am trying to find the minimum value by using min(min_values).

Best Answer

You probably have a variable that you mistakenly named ‘min’. (This is called ‘overshadowing’ a MATLAB function with a variable.)
Type this in your Command Window:
which min -all
If the first result is:
min is a variable.
You have found the problem. The solution is to rename the variable ‘min’ to something else.