I have a 3D matrix with the dimensions 6, 2, and 10. I want the row dimension to switch places with the height dimension, that is, 10-2-6. reshape doesn’t achieve this the way I want.
How can this be done? Can I rotate the matrix?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I think you’re looking for
permute. For your case it’s,permute(A,[3 2 1]);. Here’s a description ofpermutefrom the documentation:It’s similar to transposing a 2D matrix.