How to create a 2D reverse matrix
Show older comments
Hi, I'm wondering how to create a reversed numerical matrix. For example, if I have a convolution h[j,k] = [1 2 3; 4 5 6; 7 8 9] then reverse h[j,k] = h[-j-k] = [9, 8 7; 6 5 4; 3 2 1]. I'm aware that you can use rot90(h, 2) and a combination of fliplr and flipud to get the results of reverse h, but are there any more direct ways to get the reverse matrix? Thanks.
Accepted Answer
More Answers (1)
a=[1 2 3; 4 5 6; 7 8 9];
reshape(flip(a(:)),size(a))
Categories
Find more on Matrices and Arrays in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!