Saving variable in txt file
37 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I wan to save my variable in a text file with save('Final.txt','acc','-ASCII'); but i want to first go over some line(pass a few line unchanged)and then save the acc variable in that text file .
0 commentaires
Réponses (2)
Image Analyst
le 8 Fév 2014
Use fopen(), fprintf(), and fclose() and you can do whatever you want. Make it look exactly how you want your text file to look.
0 commentaires
Ken Atwell
le 9 Fév 2014
Let us say that that final.txt already have the lines you want to begin with. Use the -append option to save:
save('final.txt', 'acc', '-ascii', '-append')
If the first lines of the file happen to be header information (column names) and you are on a new release of MATLAB, you may find the table type and its writetable function to be convenient.
0 commentaires
Voir également
Catégories
En savoir plus sur Low-Level File I/O 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!