Putting three separate arrays into one new array

2 visualizaciones (últimos 30 días)
Cody Phillips
Cody Phillips el 26 de Mzo. de 2021
Comentada: Cody Phillips el 26 de Mzo. de 2021
Hi. I am sorry if this has been answered 10 million times (I'm not sure what to search to find what I need).
I have three variables that are all 10x1 arrays. I want to create a new variable that is a 10x3 array, but each column has the data from the original three arrays. How do I do this? I tried NewArray = {array1, array2, array3}; but the data looks funny and it doesn't seem to load when I try to make it into a boxplot.
Any help would be greatly appreciated, and thank you for your time.

Respuesta aceptada

per isakson
per isakson el 26 de Mzo. de 2021
Try
NewArray = [array1, array2, array3];
or
NewArray = horzcat(array1, array2, array3);
instead
  1 comentario
Cody Phillips
Cody Phillips el 26 de Mzo. de 2021
Ahhhhhh.. It was that simple. Thank you for your help! I appreciate you.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Multidimensional Arrays en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by