Difficulties with WFDB toolkit in Matlab
Show older comments
I downloaded the WFDB Toolbox for Matlab onto my Mac and successfully ran the demonstration tests to prove that the download had happened.
However, when I try to open and examine the MIMIC2 database, I am running into what seems to be path problems. I used rdsamp to open the database (from the command window) as follows and get the error message right below:
>> [signal,Fs,tm]=rdsamp('mimic2wdb/30', [1 3 5],1000);
Error using rdsamp (line 203)
Could not find record: mimic2wdb/30. Search path is set to: '. /Users/ramkrishnan/Desktop/MIMIC to Matlab/mcode/../database/
I also tried
urlread(['http://physionet.org/physiobank/database/' 'mimic2wdb/30' '/RECORDS'],1)
but got an error that the records were too long.
By the way, the demo with the MITDB record appears to work because it (MITDB) seems to be loaded onto my drive. The problem is accessing the remote physionet db.
Anybody have suggestions on how to open and examine the MIMIC2 or MIMIC3 db from Matlab?
Thanks
Ram
1 Comment
Ram Krishnan
on 16 Jul 2024
Answers (1)
Nidhi Sawant
on 28 May 2025
0 votes
I was facing issues reading .dat files (WFDB format) in MATLAB due to errors with the WFDB toolbox, especially while trying to load signal and annotation data from PhysioNet datasets. Since the MATLAB WFDB integration wasn't working reliably (e.g., missing JAR files, unresolved classes), I created a workaround using Python inside MATLAB.
I used the Python wfdb package and called it from MATLAB using pyrunfile. This approach reads the .dat files and returns the signals and annotations correctly into MATLAB.
I’ve shared a complete working example here:
This may help others dealing with similar toolbox compatibility issues.
Let me know if you have suggestions or need help setting it up!
Categories
Find more on Downloads 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!