MATLAB: How to create a numeric array using entries from the 3D matrix

arrayarraysmatricesmatrixnumeric arraynumeric arrayssyntax

If I have a 50x1x10 matrix, and I want to create a 10×1 numeric array, using the 50th entry from each of the 10 columns in the 3D matrix, how can I accomplish this?
I'm currently doing in manually using the following code (my 3D matrix is called 'C', my 10×1 array 'lastposition'), but I am sure there must be some way I can change the syntax for a less brute foce method, and also so that I can scale up to set of entries larger than 10.
Thank you in advance!

Best Answer

  • result=A(50,1,:);
    >> whos numeric_array
    Name Size
    numeric_array 10x1