Some quick answers:
(1) LabVIEW does "autoindexing" on loop boundaries if desired. The 2D array comes in and the first iteration gets the first row, the second iteration the second row, etc. until all input has been processed. The number of rows in the input array automatically determines how many times the loop must run. Isn't that nice!
(2) These are just some programming tricks. the 1,2,4 together with the comparison operation give a unique number for each possible combination of columns 1-3, basically a binary polynomial.
For example, if the numbers are [.999985, 0, .999985] and I do a [not equal zero?], I get a boolean array of [true, false, true], the "boolean to 0,1" converts this to [1, 0, 1]. Multiplied by the array
[1,2,4] gives [1, 0, 4] and the sum is 5. All other possible combinations also give a unique number:
[0,0,0]->0, [1,0,0]->1, [0,1,0]->2, [1,1,0]->3, ... [1,1,1]->7. Do you see the pattern? If you look at your matlab rules, we apparently need to sort the rows by this number determined from column 1-3, pick the last two numbers of each row, and line them all up for the final result.
The "sort array" tool has a feature that arrays of clusters are sorted primarily by the first cluster element. Thus, for each row I form a cluster of the magic number determined from columns 1-3 and an array of the last two elements in the row. This magically tuns into an array at the loop boundary. Each element of the array contains the magic number and the last two elements of the row. This array is now sorted according to the number. The next loop takes the now sorted array of clusters, and strips out the numbers we need for the result, giving us a 6x2 array that we need to reshape into a 12x1 array f
or the final result.
Let me know if this is clear enough. You can also create some temporary indicators (right-click on the wire... create indicator), e.g. for the wires right before and after sorting to see the intermediary data.