i need to reshape rows that are in complicated manner!
Show older comments
I have data in rows which is a bit complicated to arrange i need a code that will arrange in columns.
Example:
If A=
[1 3 5 7 9
2 4 6 8 10
1 3 5 7 9
2 4 6 8 10
1 3 5 7 9
2 4 6 8 10
1 3 5 7 9
2 4 6 8 10]
thats what data looks like. 1 and 2 rows contains data of same category so i want them to be arranged in a single column,same goes for the other three pairs in total i need 4 columns. but the reshaping command will put the 2nd column 1st value exactly after last value.
Accepted Answer
More Answers (2)
John D'Errico
on 18 Dec 2016
Easy.
A = reshape(A',10,4);
A =
1 1 1 1
3 3 3 3
5 5 5 5
7 7 7 7
9 9 9 9
2 2 2 2
4 4 4 4
6 6 6 6
8 8 8 8
10 10 10 10
Mahrukh Farooq
on 19 Dec 2016
Categories
Find more on Programming 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!