Hello,
I understand you have matrix 'A' with dimensions (n_particle x 3 x n_steps) and you want to see the evolution of particle 1 so the output would be of dimensions (1 x 3 x n_steps).
When I tried with a random matrix, I can obtain the top of the matrix as a tensor.
I assume a matrix K with dimensions (2,1,3) , as you know, if you want to obtain the face of the matrix you can use K(:,:,1)
K=rand(2,3,2)
K(:,:,1);
To obtain the top of the matrix as a tensor, you can use K(1,:,:)
K(1,:,:)
To make the analysis of evolution easier , you can try using the "squeeze" function to store all rows at the top of 'K' in a 2D matrix. This function returns an array with the same elements as the input array 'K', but with dimensions of length 1 removed.
m=squeeze(K(1,:,:))'
Please refer to the MathWorks documentation to know more about
- "Multidimensional Arrays"-https://in.mathworks.com/help/matlab/math/multidimensional-arrays.html
- "squeeze"-https://in.mathworks.com/help/matlab/ref/squeeze.html
Hope that helps