How to print the element of a cell into a text file?
1 次查看(过去 30 天)
显示 更早的评论
Hello all,
I have a 1X8 cell array with all its elements are 1X300 cells and each of those 300 cells are 4X1 doubles. I would like to print the cell array into a .txt file. I would appreciate if somebody can help me please. Thanks.
0 个评论
采纳的回答
Azzi Abdelmalek
2014-3-28
If A is your cell array
M=cell2mat(cellfun(@(x) cell2mat(x),A','un',0))
dlmwrite('file.txt',M)
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Multidimensional Arrays 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!