Efficiently writing code to txt file

1 回表示 (過去 30 日間)
Roy Veldhuizen
Roy Veldhuizen 2012 年 7 月 24 日
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 Center および File ExchangeText Data Preparation についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by