필터 지우기
필터 지우기

how to combine 2 unequal matrices

조회 수: 1 (최근 30일)
shanmukh
shanmukh 2013년 8월 8일
I have 2 matrices A and B, i want to combine them to get C
A={
1
2
3}
B={
4
5}
C={
1 4
2 5
3
}

답변 (1개)

the cyclist
the cyclist 2013년 8월 8일
Here is one possible way:
Am = length(A);
Bm = length(B);
Cm = max(Am,Bm);
C = cell(Cm,2);
C(1:Am,1) = A;
C(1:Bm,2) = B;

카테고리

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

제품

Community Treasure Hunt

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

Start Hunting!

Translated by