Global Index (short | long) | Local contents | Local Index (short | long)
maxind = findmax(x);
maxind = findmax(x); This function returns the location of the minimum and maximum values in a matrix x.
This function calls | |
---|---|
function maxind = findmax(x); szx = size(x); nd = length(szx(szx ~= 1)); maxind = 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))]); maxind(i) = find(max(tem1') == maxx); tem1 = tem1(maxind(i), :); end end maxind(nd) = find(tem1 == maxx);