a=1 2 3 4 5 6 7 8 9 b=0 1 1 2 3 2 3 2 1 resultant matrix is 1 0 2 1 3 1 4 2 5 3 6 2 7 3 8 2 9 1
    조회 수: 5 (최근 30일)
  
       이전 댓글 표시
    
a=1 2 3
  4 5 6
  7 8 9
b=0 1 1
  2 3 2
  3 2 1
How do I interleave columns?
resultant matrix is   1 0 2 1 3 1
                      4 2 5 3 6 2
                      7 3 8 2 9 1
댓글 수: 1
답변 (2개)
  Azzi Abdelmalek
      
      
 2014년 10월 27일
        a=[1 2 3;  4 5 6; 7 8 9]
b=[0 1 1;  2 3 2; 3 2 1]
[n,m]=size(a)
c=zeros(n,2*m)
c(:,1:2:end)=a
c(:,2:2:end)=b
댓글 수: 0
  Jan
      
      
 2014년 10월 27일
        a = [1 2 3;  4 5 6;  7 8 9];
b = [0 1 1;  2 3 2;  3 2 1];
c = reshape([a; b], 3, 6)
댓글 수: 0
참고 항목
카테고리
				Help Center 및 File Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!