Sum of letters in matlab

Asumming that I have a string = 'abcd'
and i want to sum 'a' and 'b' to be z = 'ab'... i guess a(1)+a(2) won't work...
so how can i do it?
basic thing to do but i'm new in matlab and just started to learn about strings.

Respuestas (1)

Walter Roberson
Walter Roberson el 15 de Abr. de 2013

0 votos

string(1:2)
or
[string(1), string(2)]
or
horzcat(string(1), string(2))

Categorías

Más información sobre Characters and Strings en Centro de ayuda y File Exchange.

Etiquetas

Aún no se han introducido etiquetas.

Preguntada:

el 15 de Abr. de 2013

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by