Hi!

I'm trying to construct a matrix from the elements of several vectors, by joining them, For example:

`a = [1 2 3];b = [4 5 6];c = [7 8 9];d = [10 11 12];`

And it should result in:

`res = 1 4 2 5 3 6 7 10 8 11 9 12`

Which is:

`res = a(1) b(1) a(2) b(2) a(3) b(3) c(1) d(1) c(2) d(2) c(3) d(3)`

I would need a method that can do this for any number of vectors with the same length.

Using a for loop and clever indexing would propably be one way, but I'm looking for a solution without using loops.

## Best Answer