how can i combine two different matrics with different size become one matric that fixed size
조회 수: 1 (최근 30일)
이전 댓글 표시
according to my question how can i combine two different matrics with different size become one matric that fixed size ex :
A = [1,2,3,4,5]
B = [1,2,3,4,5,6,7,8]
becoming one matric that fixed size 1x15
C = [1,2,3,4,5,1,2,3,4,5,6,7,8,0,0]
or
A = [1,2,3,4,5]
B = [1,2,3,4,5,6,7,8,9,10]
becoming one matric that fixed size 1x15
C = [1,2,3,4,5,1,2,3,4,5,6,7,8,9,10]
댓글 수: 0
채택된 답변
Azzi Abdelmalek
2013년 5월 28일
편집: Azzi Abdelmalek
2013년 5월 28일
C=zeros(1,15);
C(1:numel(A)+numel(B))=[A B]
추가 답변 (1개)
Iain
2013년 5월 28일
Take your pick:
C(15) = 0; C(1:numel(A)) = A; C((numel(A)+1):(1+numel(A)+numel(B))) = B;
C = [A, B, zeros(1,desired_size-numel(A)-numel(B))] ;
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Matrices and Arrays에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!