MATLAB Answers

How to arrange a Matrix in different shape?

6 views (last 30 days)
sama
sama on 17 May 2018
Commented: sama on 17 May 2018
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

  0 Comments

Sign in to comment.

Accepted Answer

Paolo
Paolo on 17 May 2018
B = fliplr(A)

  1 Comment

Sign in to comment.

More Answers (1)

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

  0 Comments

Sign in to comment.

Sign in to answer this question.