Switch elements of the 2nd and 3d dimension in 3D matrix

6 次查看(过去 30 天)
Consider a 3D array of dimensions i X j X k in the form:
Which is formed by repeating the i X j matrix for k times. I would like to switch the elements without using a loop to have a new iXkXj matrix of the form:

采纳的回答

michio
michio 2016-9-11
Have you tried permute function? http://www.mathworks.com/help/matlab/ref/permute.html I am guessing
B = permute(A,[1,3,2])
would do the job, where A is your original 3D matrix.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Resizing and Reshaping Matrices 的更多信息

产品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by