Combining two character arrays so that the elements of one of them is added in between the elements of the other one
11 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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 commentaires
Réponse acceptée
Stephen23
le 31 Mar 2021
x = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
a = 'AAAAAAAAAAAAAAAAAAAAAAAAAA';
out = reshape([a;x],1,[])
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Matrices and Arrays dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!