Get corresponding value of a 3D matrix using an index vector
Mostra commenti meno recenti
Hello,I have a 3D matrix, dimesion 37*30*1000. And an index vector i, dimension 37*1, containing the index of the column I want to get the value for each row from 1--> 37
Could anyone tell me how to get the 37*1*1000 new matrix from the original matrix and the index vector?
Thank you,
1 Commento
Stephen23
il 24 Ott 2018
Question is continued here:
Risposte (1)
KSSV
il 24 Ott 2018
A = rand(37,30,100) ;
C = 3 ; % say you need third columns from each
iwant = zeros(37,1,100) ;
for i = 1:100
iwant(:,1,i) = A(:,C,i) ;
end
1 Commento
heidi pham
il 24 Ott 2018
Categorie
Scopri di più su Matrix Indexing in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!