How to put a vector in a file?
46 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Bruno Souza
am 14 Feb. 2018
Bearbeitet: Stephen23
am 20 Feb. 2018
I'd like to create a vector from 1 to 744 (vertically) and put that in a file .txt
1
2
3
..
..
744
Thanks
0 Kommentare
Akzeptierte Antwort
Stephen23
am 14 Feb. 2018
Bearbeitet: Stephen23
am 14 Feb. 2018
[fid,msg] = fopen('filename.txt','wt');
assert(fid>=3,msg)
fprintf(fid,'%d\n',1:744)
fclose(fid);
Or
V = 1:744;
dlmwrite('filename.txt',V(:),'newline','pc')
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Variables finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!