How can i export a data to tab (10 character space) separated text file...
2 ビュー (過去 30 日間)
古いコメントを表示
I have a n*m matrix at matlab and i need to export them to a txt file and it is important to have 2 features:
1- data should be separated by tab(\t)
2- they have to be scientific number with 8 number precision at this format 0.00000000
0 件のコメント
採用された回答
Azzi Abdelmalek
2013 年 6 月 23 日
編集済み: Azzi Abdelmalek
2013 年 6 月 23 日
A=rand(4)
dlmwrite('myfile.txt', A, 'precision', '%.8f','newline', 'pc','delimiter','\t')
0 件のコメント
その他の回答 (1 件)
Walter Roberson
2013 年 6 月 23 日
fmt_item = '%f.8';
delim = '\t';
nl = '\n';
fmt = [repmat( [fmt_item delim], 1, size(YourMatrix,2)-1 ), fmt_item, nl];
fid = fopen('YourOutput.txt', 'wt');
fprintf(fid, fmt, YourMatrix .' );
fclose(fid);
2 件のコメント
参考
カテゴリ
Help Center および File Exchange で Large Files and Big Data についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!