MATLAB: Save element value of a 3D matrix

3d matrixelement value

Hello to you all!
I have a 3D Matrix A: 119x119x18.
I would like to store the value of the element (I_row=54, I_col=60) for all the 18 matrices at the z direction.
Is this the correct way to do this?
B = A(I_row, I_col,:,:)
Thank very much in advance!

Best Answer

B=A(I_row,I_col,:)
The line above will do it.