How do I get the index of the smallest element in an array in matlab?
-
3the same answer from this question applies here: stackoverflow.com/questions/3673804/matlab-matrix-questionAmro– Amro2010-09-16 19:57:08 +00:00Commented Sep 16, 2010 at 19:57
-
Related: How can I find the maximum or minimum of a multi-dimensional matrix in Matlab?gnovice– gnovice2010-09-16 19:58:23 +00:00Commented Sep 16, 2010 at 19:58
-
dup: matlab - argmax and argminShai– Shai2014-12-03 07:46:44 +00:00Commented Dec 3, 2014 at 7:46
Add a comment
|
2 Answers
Use the min() function with 2 output arguments. The first returned value will be the value, the second will be the index of that value.