Your question is unclear but I think I get what you're asking.
I assuming 'dist' is a matrix of distances were columns are gauge stations and rows are 'points' such that dist(i,j) is the distance between point(i) and station(j).
minValues(i) is the minimum distance between point(i) and all of the gauge stations (or the other way around, depending on how your matrix is organized).
minIndices(i) is the column number of 'dist' that contains the minimum for row(i). In other words, minIndices(i) tells you the gauge station that is closest to point(i).
To summarize, minValues(1:5) are the minimum distances for points(1:5) and the nearest gauge stations for those points are minIndices(1:5).
To create a linear index of the 'dist' matrix:
x = sub2ind(size(dist), 1:length(minIndices), minIndices');