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 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