convert a cell array of string into a single string

63 次查看(过去 30 天)
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

采纳的回答

the cyclist
the cyclist 2017-3-8
编辑:the cyclist 2017-3-8
strjoin(A)
will create a character array.
string(strjoin(A))
will create a string.

更多回答(1 个)

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

类别

Help CenterFile Exchange 中查找有关 Characters and Strings 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by