Effacer les filtres
Effacer les filtres

Concatenate cell array into one string

12 vues (au cours des 30 derniers jours)
Artyom
Artyom le 29 Août 2014
Hi. I want to concatenate a cell array {'a', 'b', 5, []} in a string 'a b 5'. How can I do this?

Réponse acceptée

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

Plus de réponses (0)

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