convert a cell array of string into a single string

61 visualizaciones (últimos 30 días)
Hi, in my program I have something like this : A = {'hello, ' 'how ' 'are ' 'you ' 'today' '?'};
And I would like to merge all those strings into one big :
B = 'hello how are you today?' B must be a string, not a cell.
Thanks you for your help

Respuesta aceptada

the cyclist
the cyclist el 8 de Mzo. de 2017
Editada: the cyclist el 8 de Mzo. de 2017
strjoin(A)
will create a character array.
string(strjoin(A))
will create a string.

Más respuestas (1)

Christine Berlingeri
Christine Berlingeri el 18 de Sept. de 2021
A = [1, 2, 3, 4, 4]
B = string(strjoin(A))

Categorías

Más información sobre Characters and Strings en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by