Concatenate cell array into one string

5 visualizzazioni (ultimi 30 giorni)
Artyom
Artyom il 29 Ago 2014
Risposto: Honglei Chen il 29 Ago 2014
Hi. I want to concatenate a cell array {'a', 'b', 5, []} in a string 'a b 5'. How can I do this?

Risposta accettata

Honglei Chen
Honglei Chen il 29 Ago 2014
x = {'a','b',5,[]}
x = cellfun(@num2str,x,'UniformOutput',false)
sprintf('%s ',x{:})

Più risposte (0)

Categorie

Scopri di più su Characters and Strings in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by