adding headers when using fprintf to write to text
Mostra commenti meno recenti
Hi,
I am writing a matrix to text using the following codes:
fid = fopen('Datav1Call_1993.txt','w+');
for idx = 1:size(DataPaper,1)
line = DataPaper(idx,~isnan(DataPaper(idx,:))); % creates the line of data without NaNs
fprintf(fid,[repmat('%d ',1,length(line)),'\n'],line);
end
fclose(fid);
how can i add headers to the columns?
1 Commento
dpb
il 30 Dic 2016
Write 'em before the loop after you open the file...result will likely be more satisfactory for looking at if you use widths on the field specifications to line things up...
Risposta accettata
Più risposte (0)
Categorie
Scopri di più su Cell Arrays in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!