I have a 3D matrix, say A=100*100*100. I want to index 5 elements from it. What I have are three 1D vector (lenght=10), say x=[1,1,2,3,4] y=[55,22,33,55,77] z=[92,32,12,9,2]. I want to index the corresponding elements in the matrix A. Say [1,55,92] [1,22,32] [2,33,12] [3,55,9] [4,77,2]. Is there a very elegant way to index these five elemtents in one sentence?
MATLAB: Indexing 3D matrix with three 1D vector
3dindexindex 3d matrixmatrixvector
Related Question
- Modifing a specific matrix that is corresponding to an indexing matrix
- Finding values corresponding to row and column index of a matrix
- Robustly using ind2sub for problems with tunable dimensionality
- 3D Matrix indexing from a vector
- Create matrix with periodic increments
- How to get all the outputs of the ind2sub function
Best Answer