0

I am trying to read an ECG signal from PTB dataset, the file extension is ".dat" ,i am using Matlab function for that:

load('s0484_re.dat');

where "s0484_re.dat" is the file name but i am getting an error like this:

Error using load Unknown text on line number 1 of ASCII file s0484_re.dat "�����\�".

Error in signal2image (line 8) load('s0484_re.dat');

how i can read this file correctly? Any help will be appreciated..

Salar Sali
  • 103
  • 1
  • 8

1 Answers1

0

The file extension .dat can be used for many different types of binary data file and doesn't tell you what format the data is in.

By searching on 'PTB dataset` I found the information that the data files in this dataset are in 'WaveForm DataBase (WFDB) format', and by searching mathworks.com for 'WFDB' I found a few links including a toolbox for handling WFDB files. Try this toolbox, and update your question if it doesn't solve your problem.

nekomatic
  • 5,988
  • 1
  • 20
  • 27
  • it worked,but now i am having another issue, when i use wfdb2mat it should generate a file with the extension .mat, but it generates nothing – Salar Sali Mar 14 '22 at 22:52
  • I suggest you ask a new question showing your code and describing any steps you've taken to troubleshoot it. – nekomatic Mar 15 '22 at 08:46
  • why wfdb2mat function is generating nothing? I am using this code to convert dat file to mat and then read the generated file: 'wfdb2mat('/home/salar/Documents/mythesis/Matlab/s0484_re')' '[tm,signal,Fs,labels] = rdmat('s0484_re.mat');' i am getting this error: 'Error using rdmat (line 78)' 'Could not open file: s0484_re.mat.hea !' my question is: why wfdb2mat function is generating nothing? thank you in advance – Salar Sali Mar 20 '22 at 22:08