How to arrange alternate cells of a column into two columns?

Illustration
Manoj Kumar - 2023-08-28T13:42:19+00:00
Question: How to arrange alternate cells of a column into two columns?

Let's say the column matrix is: A = 2 6 7 3 8 3 2 9 7 5 4 1     And I need to obtain final result as A = 2 6 7 3 8 3 2 9 7 5 4 1 Can I know the way to split in this way?

Expert Answer

Profile picture of Kshitij Singh Kshitij Singh answered . 2025-11-20

A = [2 6 7 3 8 3 2 9 7 5 4 1]'

A = 12×1 2 6 7 3 8 3 2 9 7 5
B = [A(1:2:end) A(2:2:end)]

B = 6×2 2 6 7 3 8 3 2 9 7 5 4 1

 


Not satisfied with the answer ?? ASK NOW

Get a Free Consultation or a Sample Assignment Review!