필터 지우기
필터 지우기

Putting three separate arrays into one new array

조회 수: 1 (최근 30일)
Cody Phillips
Cody Phillips 2021년 3월 26일
댓글: Cody Phillips 2021년 3월 26일
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.

채택된 답변

per isakson
per isakson 2021년 3월 26일
Try
NewArray = [array1, array2, array3];
or
NewArray = horzcat(array1, array2, array3);
instead
  댓글 수: 1
Cody Phillips
Cody Phillips 2021년 3월 26일
Ahhhhhh.. It was that simple. Thank you for your help! I appreciate you.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Multidimensional Arrays에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by