Combining two character arrays so that the elements of one of them is added in between the elements of the other one
10 ビュー (過去 30 日間)
古いコメントを表示
I want to combine two character arrays
x='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
and
a='AAAAAAAAAAAAAAAAAAAAAAAAAA'
so that A is alterantingly added to each letter of x. the output should look like this:
Output='AAABACADAEAFAG...AZ'
0 件のコメント
採用された回答
Stephen23
2021 年 3 月 31 日
x = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
a = 'AAAAAAAAAAAAAAAAAAAAAAAAAA';
out = reshape([a;x],1,[])
その他の回答 (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!