function indices = argmin(v)
% ARGMIN Return as a subscript vector the location of the smallest element of a multidimensional array v.
% indices = argmin(v)
%
% Returns the first minimum in the case of ties.

[m i] = min(v(:));
if isvector(v)
  indices = i;
else
  indices = ind2subv(size(v), i);
end
