Concatenate cell array into one string

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 日

2 投票

x = {'a','b',5,[]}
x = cellfun(@num2str,x,'UniformOutput',false)
sprintf('%s ',x{:})

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeCharacters and Strings についてさらに検索

質問済み:

2014 年 8 月 29 日

回答済み:

2014 年 8 月 29 日

Community Treasure Hunt

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

Start Hunting!

Translated by