How can I read a ".dat" and ".hea" file in to MATLAB?

조회 수: 209 (최근 30일)
DRISHYA S KUMAR P N
DRISHYA S KUMAR P N 2021년 7월 4일
댓글: Michelle Gee 2024년 10월 16일
Currently i am working on project which use Photo Plythismo Graph (ppg). But the data is in .dat and .hea format.
I am looking a code to get a visualize view of these PPG.
If anyone have any idea about this please add a comment on this post. Your help would be greatly appreciate and it really help my project.
  댓글 수: 3
Indrayudh Datta
Indrayudh Datta 2023년 7월 11일
Hey! I tried running this code on the Online MatLab platform and It keeps throwing the following erros:
Error using rdmat Could not open file: /MATLAB Drive/100.dat.hea !
This happends when I define the file path and mention the file extension as .dat
When I do not mention the file extension and only the file name, I get the following error
Error in rdmat (line 144) load([recordName '.mat']);
Any idea what I am doing wrong?
Michelle Gee
Michelle Gee 2024년 10월 16일
I get the same errors when I do that as well. Monika's solution using mdfimport didn't work for my particular dataset, but it probably works for others.
I finally ended up using the rdsamp.m function in the wfdb toolbox. What's not very clear in the documentation is that rdsamp automatically reads files from some remote server with all of the Physionet data. What is even less clear is how to then figure out what path you should use to access the specific dataset you want. You can find the path in the files section of the physionet dataset you want to use (Ex: https://physionet.org/content/mitdb/1.0.0/). The provided bullet point is
  • Download the files using your terminal: wget -r -N -c -np https://physionet.org/files/mitdb/1.0.0/
Just use whatever is in the 'mitdb' part then the record number. The record number is the filename (101 for 101.hea, 101.atr, etc.)
The code looks like this:
[signal,Fs,tm]=rdsamp('mitdb/101',[],1000);

댓글을 달려면 로그인하십시오.

답변 (2개)

Andrea Nemcova
Andrea Nemcova 2021년 9월 7일
Hello,
I am one of the authors of this database and I am glad you chose the BUT PPG database for your research. May I ask you what is your research dealing with?
More information about the database is included in this brand new article: https://www.hindawi.com/journals/bmri/2021/3453007/ .
The data are in standard WFDB format (very common on Physionet). This format (including .dat and .hea) can be read using WFDB toolbox https://archive.physionet.org/physiotools/matlab/wfdb-app-matlab/ .
I hope this helps. If you have any further question, feel free to ask.
Best regards,
Andrea Nemcova

Monika Jaskolka
Monika Jaskolka 2021년 7월 4일
To import dat files I use the mdfimport tool found on the Matab File Exchange

카테고리

Help CenterFile Exchange에서 Large Files and Big Data에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by