Problem 43682. Pairwise column flip
Given matrix M_in, flip every pair of columns. So if M_in is
1 2 3 4 1 2 3 4
then M_out is
2 1 4 3 2 1 4 3
Note: if M_in has odd number of columns, the last column should remain unchanged. So if M_in is
17 24 1 8 15 23 5 7 14 16 4 6 13 20 22 10 12 19 21 3 11 18 25 2 9
then M_out is
24 17 8 1 15 5 23 14 7 16 6 4 20 13 22 12 10 21 19 3 18 11 2 25 9
Solution Stats
Problem Comments
Solution Comments
Show commentsProblem Recent Solvers40
Suggested Problems
-
Numbers with prime factors 2, 3 and 5.
475 Solvers
-
How many trades represent all the profit?
599 Solvers
-
Rounding off numbers to n decimals
4505 Solvers
-
Find out sum of all elements of given Matrix
499 Solvers
-
Test Problem; Create a 5x5 array containing all ones
384 Solvers
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!