.dat file editing
5 ビュー (過去 30 日間)
古いコメントを表示
Hi, I need help with some beginner lvl stuff in matlab. I have a .dat file, with 3 colums of long data, that I want to use in another program for research. I would like to open the file, and multiply/add every value of the first column with a fixed number. Then after the values are changed, i would want to save it under a new name, but still as a .dat file, so I can use it outside of matlab. Can anyone help me with this? Thx in advance
0 件のコメント
回答 (1 件)
KL
2017 年 5 月 3 日
編集済み: KL
2017 年 5 月 3 日
data_in = dlmread('sample.dat');
data_out = [data_in(:,1)*2, data_in(:,2)+4, data_in(:,3)];
save my_data.dat data_out -ASCII
10 件のコメント
KL
2017 年 5 月 4 日
that's surprising. I created my own dat file with few values of similar precision and the import works fine.
参考
カテゴリ
Help Center および File Exchange で Standard File Formats についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
