Hello, I have two 3D arrays a (3x5x4) and o (1x5x4). What I would like to achieve is to use o array as index for a. The struggle is when I use the function below it would take whole o array when creating new array x (1x5x4), maybe anyone has any idea. I thought about pagefun, but it works with only predefined functions.
a=rand(3,5,4)o= cat(3,[2 5 1 2 4],[2 5 3 1 5],[2 2 2 4 4],[2 3 1 5 4])x=a(2,o,:)
Best Answer