Now that is the kind of wondering that lead me to the project which lead me to the challenger!
I think we can see what is going on by taking it one at a time:
So this produces the same thing as this:
Now it makes sense: Take - Row one, then Row two, then Row one, then Row two for all higher dimensions (i.e., for each column and page).
Similarly with the other indexing arrays.
REPMAT and BSXFUN are deep funtions in terms of really understanding how they (and consequently, MATLAB indexing in general) work.
Best Answer