How to horizontally merge cells of strings/chars for each row without writing a for-loop?
3 次查看(过去 30 天)
显示 更早的评论
I have some m*n cells of char arrays, and the figure serves as an example for that. Is it possible to horizontally merge char arrays of each rows like 'B659' and 'Z01' to 'B659Z01' without using a for-loop to iterate each row?
0 个评论
采纳的回答
Walter Roberson
2022-11-21
fmt = repmat('%s', 1, size(YourCell,2));
output = compose(fmt, string(YourCell));
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Creating and Concatenating Matrices 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!