主题:[讨论]matlab中求最小值
xidianxiancai
[专家分:0] 发布于 2009-05-08 11:09:00
假定给定一序列,可以用matlab中的min函数求出该序列的中的最小值,但是不能得到该最小值所在的位置,除非用循环进行一个一个的判断。那么请问,matlab中有没有这样的一个函数,即可以求得该序列的最小值,又可以得到其所在的位置?谢谢
回复列表 (共1个回复)
沙发
ronei [专家分:360] 发布于 2009-05-08 16:41:00
[Y,I] = MIN(X) returns the indices of the minimum values in vector I.
If the values along the first non-singleton dimension contain more
than one minimal element, the index of the first one is returned.
我来回复