convert a cell array of string into a single string

63 ビュー (過去 30 日間)
Marc-Olivier Labrecque-Goulet
Marc-Olivier Labrecque-Goulet 2017 年 3 月 8 日
回答済み: Christine Berlingeri 2021 年 9 月 18 日
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
Christine Berlingeri 2021 年 9 月 18 日
A = [1, 2, 3, 4, 4]
B = string(strjoin(A))

カテゴリ

Help Center および File ExchangeCharacters and Strings についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by