For a data set with two samples idx is treated as a matrix rather than a vector.
"When indexing arrays by [ a single argument i can be a matrix with as many columns as there are dimensions of x; the result is then a vector with elements corresponding to the sets of indices in each row of i."
For a data set with two samples idx is treated as a matrix rather than a vector.
"When indexing arrays by [ a single argument i can be a matrix with as many columns as there are dimensions of x; the result is then a vector with elements corresponding to the sets of indices in each row of i."