Efficiently writing code to txt file

1 次查看(过去 30 天)
Hello everybody,
I want to write code to a txt file, to import it in another program later. However, my data-matrix called Output is rather large (90941x12 units)
The code i'm using now is the following:
fid = fopen(fullfile('Darab Export','Output File 2.txt'), 'w+');
fprintf(fid,'%s\t',parts{1:end-1}); %# Write all but the last label
fprintf(fid,'%s\r\n',parts{end}); %write last label and new line
fclose(fid);
dlmwrite(fullfile('Darab Export','Output File 2.txt'), [Output],'delimiter','\t','newline', 'pc','precision','%.6f','-append') %write data
But it is working rather slow. Is this the most efficient way of writing data to a txt file, or are there faster methods?
Thanks in advance.

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Text Data Preparation 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by