How to arrange a Matrix in different shape?

2 次查看(过去 30 天)
Hello, I have a very simple question but cannot find the answer now. Imagine I have a matrix A=[a b c], is there any function to make it B=[c b a]? Thanks

采纳的回答

Paolo
Paolo 2018-5-17
B = fliplr(A)

更多回答(1 个)

Fangjun Jiang
Fangjun Jiang 2018-5-17
A=magic(3);
B=A(:,[3 2 1])
or
B=A(:,[end:-1:1])

类别

Help CenterFile Exchange 中查找有关 Creating and Concatenating Matrices 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by