Add label to TXT file
3 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Hi,
i'm using this command to create a .txt of data. The data are placed in the first row. Is there a way to add fix labels in the first row and put the data in the second row? Thanks a lot for any help.
dlmwrite('c:\data.txt', y, 'delimiter', '\t');
0 Kommentare
Antworten (2)
Kevin Holst
am 23 Mär. 2012
you could just add a simple fopen command prior to your dlmwrite command:
fid = fopen('c:\data.txt','w');
fprintf(fid,'H2 CO CO2 Ar');
fclose(fid)
dlmwrite('c:\data.txt',y,'-append','delimiter','\t');
0 Kommentare
Giuseppe Bregliozzi
am 23 Mär. 2012
1 Kommentar
Kevin Holst
am 23 Mär. 2012
The intent was for you to replace 'Your Text Here' with the line that you're wanting. In this case my understanding is that you would want fprintf(fid,'H2 CO CO2 Ar');
I've adjusted my answer accordingly.
Siehe auch
Kategorien
Mehr zu Data Import and Export 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!