Combining two character arrays so that the elements of one of them is added in between the elements of the other one
9 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Saeid
el 30 de Mzo. de 2021
Comentada: Saeid
el 31 de Mzo. de 2021
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 comentarios
Respuesta aceptada
Stephen23
el 31 de Mzo. de 2021
x = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
a = 'AAAAAAAAAAAAAAAAAAAAAAAAAA';
out = reshape([a;x],1,[])
Más respuestas (0)
Ver también
Categorías
Más información sobre Cell Arrays en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!