Combining two character arrays so that the elements of one of them is added in between the elements of the other one
10 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
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 Kommentare
Akzeptierte Antwort
Stephen23
am 31 Mär. 2021
x = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
a = 'AAAAAAAAAAAAAAAAAAAAAAAAAA';
out = reshape([a;x],1,[])
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Matrices and Arrays finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!