Info

此问题已关闭。 请重新打开它进行编辑或回答。

swap matrix positions in 3d matrices

2 次查看(过去 30 天)
Jam
Jam 2013-1-17
关闭: MATLAB Answer Bot 2021-8-20
How do I swap matrix positions? So if I wanted
a(1,1,:) = [1 2 3 4];
a(1,2,:) = [1 1 1 1];
to become
a(1,1,:) = [1 1 1 1];
a(1,2,:) = [1 2 3 4];
  1 个评论
Jan
Jan 2013-1-17
Such questions are discussed exhaustively in the Getting Started chapters of the documentation. It is recommended to read them.

回答(2 个)

Andrei Bobrov
Andrei Bobrov 2013-1-17
编辑:Andrei Bobrov 2013-1-17
a(1,1:2,:) = a(1,[2,1],:);

Colin
Colin 2013-1-17
a(1,[1 2],:) = a(1,[2 1],:);

此问题已关闭。

标签

产品

Community Treasure Hunt

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

Start Hunting!

Translated by