Save signal as .dat file

191 次查看(过去 30 天)
hajer
hajer 2011-12-28
评论: Hafsa Asad 2018-12-18
Hi , i have signal and i want to save it after modified(save as .dat ) how i can do that ?
  1 个评论
Walter Roberson
Walter Roberson 2011-12-28
There is no standard format for .dat files. .dat is used as an extension to indicate data files in some format that is private or unique to the program. Usually .dat is a binary format that would have to be written using the low level I/O routines.
We would have to know the exact internal format used by whatever program you would be reading this in with.

请先登录,再进行评论。

回答(2 个)

Wayne King
Wayne King 2011-12-28
x = randn(100,1);
save test.dat x -ascii
% or
save('c:\folderyouwant\test.dat','x','-ascii');
save supports other options as well.
  2 个评论
hajer
hajer 2011-12-28
thank you ,but i do not know the name of file because the name of file is entrance by the user
Walter Roberson
Walter Roberson 2011-12-28
When you use the () form of save, the first parameter can be a variable name that contains the file name. For example
UserFile = 'c:\folderyouwant\test.dat';
save(UserFile, 'x', '-ascii')

请先登录,再进行评论。


Hafsa Asad
Hafsa Asad 2015-3-22
dlmwrite('myfile.dat', my_matrix_vals)

类别

Help CenterFile Exchange 中查找有关 Data Import and Analysis 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by