convert a cell array of string into a single string

65 vues (au cours des 30 derniers jours)
Marc-Olivier Labrecque-Goulet
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

Réponse acceptée

the cyclist
the cyclist le 8 Mar 2017
Modifié(e) : the cyclist le 8 Mar 2017
strjoin(A)
will create a character array.
string(strjoin(A))
will create a string.

Plus de réponses (1)

Christine Berlingeri
Christine Berlingeri le 18 Sep 2021
A = [1, 2, 3, 4, 4]
B = string(strjoin(A))

Catégories

En savoir plus sur Characters and Strings dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by