EMChamp
EMChamp

Reputation: 449

Matlab: Interlace two arrays into one array

I want to merge two arrays in Matlab like this

A = [1 2; 
     3 4]

B = [5 6;
     7 8]

C = [1 5;
     3 7;
     2 6;
     4 8]

Upvotes: 0

Views: 915

Answers (1)

bla
bla

Reputation: 26069

use the : operator:

C = [A(:) B(:)]

Upvotes: 4

Related Questions