필터 지우기
필터 지우기

how can i combine 4 matrix as 1

조회 수: 4 (최근 30일)
bhavisha parmar
bhavisha parmar 2015년 10월 7일
답변: Star Strider 2015년 10월 7일
for example A=[1 2],B=[3 4],C=[5 6] and D=[7 8] then the resultant matrix E E=[1 2 3 4
5 6 7 8]
it means it becomes 2*4 matrix

답변 (1개)

Star Strider
Star Strider 2015년 10월 7일
You need to horizontally concatenate the vectors, then use the reshape function:
A=[1 2];
B=[3 4];
C=[5 6];
D=[7 8];
E = reshape([A B C D], [], 2).'
E =
1 2 3 4
5 6 7 8

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by