Restructure array
1 view (last 30 days)
Show older comments
How can I reorganize the following array?
A= [m1; m2][n1; n2; n3][p1; p2; p3][q1; q2; q3; q4]
into
B =[m1; n2; p1; q1][m2; n2; p2; q2][n3; p3; q3][q4]
Thank you
0 Comments
Accepted Answer
Walter Roberson
on 16 Oct 2011
Unless those variables indicate vectors or arrays with harmonious sizes, neither of those arrays is allowed: numeric arrays cannot be varying length.
What do you intend your notation for A to mean? The notation you give is not valid MATLAB notation. Are you trying to indicate a 3 dimensional array, such as would be formed by
cat(3, [m1;m2], [n1;n2;n3], [p1;p2;p3], [q1;q2;q3;q4])
(but only if the sizes happen to match up) ?
More Answers (0)
See Also
Categories
Find more on Multidimensional 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!