Concatenate string output to another string vertically in a loop
10 次查看(过去 30 天)
显示 更早的评论
Hi,
I have a loop which generate for every run a string output (loop size index is changing depends on how much files are in the directory). How can I concatenate the string output to another string vertically/send them into char/etc so I can save the final output (all the string output results) to a one text file?
Any idea is welcome.
Thanks.
0 个评论
回答(2 个)
Matt J
2012-10-16
Assuming you've read the strings into a cell array you can use CHAR to concatenate them, e.g.,
>> char({'car','apple'})
ans =
car
apple
2 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Characters and Strings 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!