Alternate sort on a bidimensional array

Hi there :slight_smile:

I’m an absolute beginner in processing and I’ve not found on the references this answer.
Can I apply an alternate sort to a bidimensional array? As 0, 1, 0, 1…

There is a standard function for this or I have to do it manually?
For example in matlab I can do a minimum sorting considering a specific vector element calling a variable into the index of the array like in vectorElem(index) from this code

 m = vectElem(1);
    indexMin = 1;
    for index=1:length(vectorElem)
        if vectorElem(index) < m
            m = vectorElem(index);
            indexMin = index;
        end
    end

Because I’ve tried and I get an error

By bidirectional I assume you mean a 2D array?

The code you post appears to find the smallest value in a vector (1D array) and its index position in the vector.

You need to explain yourself more clearly :slightly_smiling_face: