I'm working on kmeans clustering algorithm, and I need to find the index of the smallest value in the array.
For example, I wrote this code for 3 item:
if ((DistanceArray[1, j] < DistanceArray[2, j]) &&
(DistanceArray[1, j] < DistanceArray[3, j]))
{
min= 1;
}
else if (DistanceArray[2, j] < DistanceArray[3, j])
{
min= 2;
}
else
{
min= 3;
}
But I need to retrieve minimum value from a multidimensional array.
How can do this?