Save output matrix to .dat file
11 ビュー (過去 30 日間)
古いコメントを表示
Hi,
How I can save my output result Matrix (100*100) to .dat file
0 件のコメント
回答 (1 件)
Walter Roberson
2015 年 11 月 25 日
".dat" is used as an extension by many different programs. There is no standard file format for it. You need to know the exact arrangement of data that is required by the program that will read in the data. There might already be a routine to do the saving (depending which program it is) or you might have to write one using fopen()/fwrite()/fclose() and memmapfile() might turn out to be useful.
2 件のコメント
Walter Roberson
2015 年 11 月 25 日
fid = fopen('YourOutput.dat', 'w');
fwrite(fid, YourArray);
fclose(fid);
Note: C indexes increase fastest along the rows but MATLAB indexes increase fastest along the columns. You may wish to transpose your data as you write it.
fwrite(fid, YourArray.' );
参考
カテゴリ
Help Center および File Exchange で Data Import and Export についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!