Global Index (short | long) | Local contents | Local Index (short | long)
minind = findmin(x);
minind = findmin(x); This function returns the location of the minimum and maximum values in a matrix x.
This function calls | |
---|---|
function minind = findmin(x); szx = size(x); nd = length(szx(szx ~= 1)); minind = repmat(NaN, [1, nd]); [minx, maxx] = range(x); tem1 = x; if nd > 1; for i = 1:(nd-1); tem1 = reshape(tem1, [szx(i) prod(szx((i+1):nd))]); minind(i) = find(min(tem1') == minx); tem1 = tem1(minind(i), :); end end minind(nd) = find(tem1 == minx);