Mixing and merge two vectors

Dear all, i want to mix and merge two vector in a one,
A = [1 2 3 4];
B = [5 6 7 8];
to get
C = [1 5 2 6 3 7 4 8];
Thanks in advance

 Respuesta aceptada

Star Strider
Star Strider el 23 de Mayo de 2017

0 votos

This works:
A = [1 2 3 4];
B = [5 6 7 8];
C = reshape([A; B], [], 1)';
C =
1 5 2 6 3 7 4 8

Más respuestas (0)

Categorías

Más información sobre SimEvents en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 23 de Mayo de 2017

Respondida:

el 23 de Mayo de 2017

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by