I have a 147093 x 1 x 1 x 6 double matrix (originally in the form of a .mgh surface file) that I read into matlab. I need to extract the first 3 values of the 6 column for each of the 147093 indices and put them into a formula (it's just calculating the angle between each vector and a constant <0,1,0> vector). Once I get the angle of every 3D vector I need to store the result in 147093 x 1 array so I can use it in another piece of software. I've attached some pictures for reference. One is the dimensions of the array in matlab, the other photo shows the 3 values for each index that I need to extract, and the other 3 that I need to leave out.
How should I go about doing this? I was thinking about writing a nested for loop, but that doesn't seem very efficient because I know Matlab has a lot of built in functions to do this type of stuff, I'm just not very familiar with them. My main problem is figuring out how to extract the exact values I need. Because I don't even want the other 3 values in the 6 column, it will mess up the calculation.
Thanks for any advice. ![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1122260/image.png)