How can I save matrix to .txt file?
815 views (last 30 days)
Show older comments
Teemu on 13 Mar 2013
Commented: Aravind Rao Karanam on 8 Jan 2022
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?
Friedrich on 13 Mar 2013
Edited: Friedrich on 13 Mar 2013
a = rand(64,60);
Aravind Rao Karanam on 8 Jan 2022
More Answers (2)
Sudhir Rai on 17 Nov 2020
Use this to get perfect matrix in .txt
X = rand(64,60)
save ('filename.txt', 'X', '-ascii')
Find more on Large Files and Big Data in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!