Saving data to a file and getting giberish
3 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I am trying to save two columns of numbers to a file, right now its a txt file but when I open the file its just a bunch of nonsense.
my code is below
fileID = fopen(filename);
a = textscan(fileID,'%u');
b = {a,a};
c =[b{1,1}{1,1},b{1,2}{1,1}];
d = double(c);
save('test.txt', 'd')
0 commentaires
Réponses (1)
Image Analyst
le 28 Juil 2020
Modifié(e) : Image Analyst
le 28 Juil 2020
That's the proprietary MAT file format. If you want text, try the -ascii option
save('test.txt', '-ascii', 'd')
or else use fopen(), fprintf(), and fclose().
0 commentaires
Voir également
Catégories
En savoir plus sur Data Import and Analysis dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!