Concatenate cell array into one string

1 回表示 (過去 30 日間)
Artyom
Artyom 2014 年 8 月 29 日
回答済み: Honglei Chen 2014 年 8 月 29 日
Hi. I want to concatenate a cell array {'a', 'b', 5, []} in a string 'a b 5'. How can I do this?

採用された回答

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

その他の回答 (0 件)

カテゴリ

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