Convert ecg file into .mat file for ECG classification

24 ビュー (過去 30 日間)
Rizwan Shaikh
Rizwan Shaikh 2022 年 7 月 7 日
編集済み: Ayush Modi 2023 年 10 月 20 日
I am working on analysis of ECG signals for detection of heart abnormalities using pretrained CNN using the dataset from iRHYHTM. The dataset comes along with single ECG file and 7 json files for every recording. I want to convert them into .mat files to extract the features and label them.
The link to the dataset is here:
  1 件のコメント
Benjamin Kraus
Benjamin Kraus 2022 年 7 月 8 日
The .ecg files are in a binary format. I didn't see anything on the File Exchange about reading files that have an .ecg file extension. Do you have any information about the file format? What program creates these files?

サインインしてコメントする。

回答 (1 件)

Ayush Modi
Ayush Modi 2023 年 10 月 20 日
編集済み: Ayush Modi 2023 年 10 月 20 日
Hi Rizwan,
As per my understanding, you would like to read “.ecg” files and store the values in .mat files.
You can achieve this using “fopen” and “fread” functions. Here is an example showing how you can do it:
fid1 = fopen('1.ecg','rt'); %Opening .ecg file for binary read access
A = fread(fid1,'*float32'); % Reading the data from an open binary file
save('output.mat','A') % Saving the data in .mat format
Please refer to the following MathWorks documentation for more information on –
I hope this resolves the issue you were facing.

カテゴリ

Help Center および File ExchangeECG / EKG についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by