필터 지우기
필터 지우기

How to combine two arrays?

조회 수: 290 (최근 30일)
SUSHMA MB
SUSHMA MB 2017년 3월 6일
답변: Opeyemi Kehinde 2021년 12월 17일
I have two arrays
x = 561x1 double
y = 561x1 double
How can i combine it into
z = 561x2 double
  댓글 수: 1
Talha Azmat
Talha Azmat 2020년 1월 7일
use combine function

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

채택된 답변

KSSV
KSSV 2017년 3월 6일
x = rand(561,1) ;
y = rand(561,1) ;
z = [x y]

추가 답변 (1개)

Opeyemi Kehinde
Opeyemi Kehinde 2021년 12월 17일
This will combine everything vertically
ba=rand(5,1);
bc=rand(5,1);
bd=cat(1,ba,bc)
bd = 10×1
0.4521 0.3754 0.6376 0.0726 0.5931 0.1914 0.1244 0.5883 0.7074 0.7833
and this will combine them horizontally
ba=rand(5,1);
bc=rand(5,1);
bd=cat(2,ba,bc)
bd = 5×2
0.7514 0.2128 0.2607 0.8915 0.1605 0.1310 0.7830 0.8906 0.2156 0.7069

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by