Open the .dat file in Matlab

44 ビュー (過去 30 日間)
Reza Bagherian Azhiri
Reza Bagherian Azhiri 2021 年 4 月 2 日
回答済み: DGM 2021 年 4 月 3 日
I have an ECG file in the format of .dat, and I wanted to change it to .mat. the file is extracted from the physionet dataset. Could you please help me?
  2 件のコメント
dpb
dpb 2021 年 4 月 2 日
Have to read in the .dat file and then save as .mat. Can't just change a file format from one to the other.
Reza Bagherian Azhiri
Reza Bagherian Azhiri 2021 年 4 月 2 日
Could you please tell me about the related codes?

サインインしてコメントする。

回答 (2 件)

Sulaymon Eshkabilov
Sulaymon Eshkabilov 2021 年 4 月 2 日
You can employ a few built in data import functions of MATLAB to read your data and then save them in *.mat file. E.g:
FN = 'MY_DATA.dat'; % Introduce your *.dat file name
FID=fopen(FN,'r');
T=10; % Introduce the time length
DATA=fread(fid,2*360*T,'ubit12'); % Adjust w.rt. your data, respectively
save('MY_data.mat', 'DATA');
fclose(FID)
Good luck

DGM
DGM 2021 年 4 月 3 日
I've never even heard of PhysioNet. It took me 15 min to do a web search and figure it out. Just sayin.
There's a basic overview here with links for the WFDB toolbox for Matlab. Download/install the toolbox.
Once it's installed, run
help wfdb2mat
and maybe try the example:
wfdb2mat('mitdb/200')
This downloads the specified dat file and makes a local copy as a .mat file with an associated .hea file.
The toolbox also includes other tools for further operation on the data.

カテゴリ

Help Center および File ExchangeStandard File Formats についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by