How can I save matrix to .txt file?
266 次查看(过去 30 天)
显示 更早的评论
I have numerical matrix size of 64*60 and I like to save it to .txt file. How can I do it as easy as possible? without repeating %d with fprintf?
0 个评论
采纳的回答
Friedrich
2013-3-13
编辑:Friedrich
2013-3-13
Hi,
use dlmwrite
a = rand(64,60);
dlmwrite('filename.txt',a)
5 个评论
Aravind Rao Karanam
2022-1-8
dlmwrite is not recommended anymore. Use writematrix
a = rand(64,60);
writematrix(a, 'filename.txt')
更多回答(2 个)
Sudhir Rai
2020-11-17
Use this to get perfect matrix in .txt
X = rand(64,60)
save ('filename.txt', 'X', '-ascii')
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Text Files 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!