How can I change cell array into strings

A ["an"] ["bn"] ["cn"] ["sb"]
How can I convert A into like this
'an' 'bn' 'cn' 'dn'

 採用された回答

KL
KL 2017 年 11 月 2 日
編集済み: KL 2017 年 11 月 2 日

0 投票

cc = cellfun(@num2str,c,'uni',0)
if you have both string and numerics in cell array and you want to convert them all to char,
cc = cell(size(c));
for k=1:numel(c)
if(isnumeric(c{k}))
cc{k} = num2str(c{k});
elseif (isstring(c{k}))
cc{kk}= char(c{k});
%and so on
end
end
Another idea is,
cellfun(@(x) char(string(x)),c,'uni',0)

その他の回答 (0 件)

カテゴリ

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

タグ

質問済み:

2017 年 11 月 2 日

編集済み:

KL
2017 年 11 月 2 日

Community Treasure Hunt

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

Start Hunting!

Translated by