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!