How can I read local ecg file using wfdb app?

44 views (last 30 days)
Kevin T
Kevin T on 30 Dec 2020
Commented: Susan on 4 Aug 2022
I only have a .dat file (no .hea file) which contains all 12 ecg leads.
I download and configure the wfdb app for matlab.
Then I run the following code,
[signal, fs, tm] = rdsamp('ecgfile.dat');
And then I got the error below,
This is my matlab directory, my .dat file is located in F:\Open ECG file data.
Could anyone help me solve this problem?
regards.
  4 Comments
Susan
Susan on 4 Aug 2022
@Julia Liu Thanks for your through explanation. I made sure the .dat file and test1.m are saved under 'C:\User\Desktop\test\mcode\', However, I still get the same error:
any idea?
Error using rdsamp (line 204)
Could not find record: SE8ECG4E. Search path is set to: 'C:\User\Desktop\test\mcode\'

Sign in to comment.

Answers (1)

Star Strider
Star Strider on 30 Dec 2020
Use the fullfile function to generate the file name with the correct path, then use that result as the argument for ‘rdsamp’.
Then save the three outputs to a ‘.mat’ file so you can load them quickly and conveniently when you need them later.
  6 Comments
Susan
Susan on 4 Aug 2022
@Star Strider I am getting the same error as Kevin got. As you suggested, I did ''Use the fullfile function to generate the file name with the correct path, then use that result as the argument for ‘rdsamp’." However still getting the same error. it seems the package defaults to searching online for my .dat file instead of searching locally even though I set the path . Any suggestions? thanks in advance!

Sign in to comment.

Categories

Find more on ECG / EKG in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!