how to concatenate array of different size
1 回表示 (過去 30 日間)
古いコメントを表示
is it possible to concatenate two array elements of various size, suppose an elements of an array c(1,1)=101010 (let 'c' is 256*8 size) and the elements of other array is d(1,1)=11 (let 'd' is 2*3 size) i want p(1,1)= 11101010..is it possible if yes plz suggest me.. Thank you in advance.
0 件のコメント
回答 (1 件)
Walter Roberson
2016 年 11 月 13 日
num_places = max( ceil(log10(d(:)+1)) );
c(1:size(d,1), 1:size(d,2)) = c(1:size(c,1), 1:size(c,2)) * 10.^num_places + d;
2 件のコメント
Walter Roberson
2016 年 11 月 14 日
num_places = max( ceil(log10(d(:)+1)) );
c(1:size(d,1), 1:size(d,2)) = c(1:size(d,1), 1:size(d,2)) * 10.^num_places + d;
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!