How to merge cells together?
17 次查看(过去 30 天)
显示 更早的评论
How do I merge cells together and separate each cell with a ';'?
0 个评论
采纳的回答
José-Luis
2014-5-6
编辑:José-Luis
2014-5-13
Two alternatives, since I am not exactly sure what you want.
a = num2cell(randi(10,10,10));
your_mat = cell2mat(a);
your_mat_alt = [a{:}];
2 个评论
José-Luis
2014-5-13
A=[ {'1'},{'1'},{'1'},{'1'},{'0'},{'1'},{'0'},{'1'}];
unique_cell = {sprintf('%s;',A{:})};
Please accept an answer if it helped you.
更多回答(1 个)
Jos (10584)
2014-5-13
Another option using STRCAT
A = {'apple.doc', 'apple.xlsx', 'apple.csv', 'banana.doc', 'banana.xlsx'}
B = strcat(A,';')
C = [B{:}]
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Cell Arrays 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!