Message Boards Message Boards

0
|
3041 Views
|
2 Replies
|
3 Total Likes
View groups...
Share
Share this post:
GROUPS:

Combining Arrays (two 2x2 into one 4x4)

Hi,

How can I transform:
a = {{4, 1}, {1, 3}};
b = {{-1, -2}, {1, -2}};
into
c = {{4, 1, -1, -2}, {4, 1, 1, -2}, {1, 3, -1, -2}, {1, 3, 1, -2}};

I.M.
POSTED BY: Ivan Morozov
2 Replies
Great, thank you David!
POSTED BY: Ivan Morozov
Posted 11 years ago
In[7]:= Flatten[Outer[Join, a, b, 1], 1]

Out[7]= {{4, 1, -1, -2}, {4, 1, 1, -2}, {1, 3, -1, -2}, {1, 3, 1, -2}}
POSTED BY: David Keith
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract