Combining two character arrays so that the elements of one of them is added in between the elements of the other one
조회 수: 11 (최근 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!