How can I read local ecg file using wfdb app?
64 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
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 comentarios
Julia Liu
el 4 de Ag. de 2022
In my case,
My .dat file is saved under D:\zMATLAB\WFDB\mcode\
The following test1.m is also saved and ran under D:\zMATLAB\WFDB\mcode\
In rdsamp.m, from line 86 - 94,
persistent javaWfdbExec config
if(isempty(javaWfdbExec))
[javaWfdbExec,config]=getWfdbClass('rdsamp');
end
config.WFDB_PATH = 'D:\zMATLAB\WFDB\mcode\'; %%%%%%% added line
%Set default pararamter values
inputs={'recordName','signalList','N','N0','rawUnits','highResolution'};
outputs={'signal','Fs','tm'};
Susan
el 4 de Ag. de 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\'
Respuestas (2)
Star Strider
el 30 de Dic. de 2020
7 comentarios
Susan
el 4 de Ag. de 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!
Mohammed Abdenacer Merbouti
el 5 de Feb. de 2024
Editada: Mohammed Abdenacer Merbouti
el 5 de Feb. de 2024
There should be at least the following three issues taken care of:
- The ".dat" file should always have its ".hea" file with it. The header (.hea) file contains plain text and can be easily deduced from the other ".hea" files of similar records.
- You should not pass the full path of the record file to the function "rdsamp".
- For example, let's say your matlab and record files have the following paths:
- F:\Open ECG file data\reader.m
- F:\Open ECG file data\records\rec001.dat
- F:\Open ECG file data\records\rec001.hea
- Then you should call "rdsamp" in the reader.m file as follows:
- [signal, fs, tm] = rdsamp('\records\rec001');
3. The full path of the records should not exceed 256 characters.
0 comentarios
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!