Convert ECG signal waveform into text file
Show older comments
Hi.
I want to ask is it possible to convert ECG signal waveform into text file? And if it is possible how to perform it?
I am able to load the ecg data file in .mat file from database and processed it through according to the matlab code written.
Answers (1)
KALYAN ACHARJYA
on 2 Mar 2021
Steps:
%load the mat file
data=load('mat_file.mat');
%Save the data in txt file
dlmwrite('filename.txt',data)
9 Comments
NOORAISYAH NABILAH
on 2 Mar 2021
KALYAN ACHARJYA
on 2 Mar 2021
Can you attach a sample ECG mat file?
NOORAISYAH NABILAH
on 2 Mar 2021
Walter Roberson
on 2 Mar 2021
%load the mat file
data=load('mat_file.mat');
%Save the data in txt file
dlmwrite('filename.txt',data.val(:))
The (:) will force it to write one value per line; the current data is a row of data values.
NOORAISYAH NABILAH
on 2 Mar 2021
KALYAN ACHARJYA
on 2 Mar 2021
NOORAISYAH NABILAH
on 2 Mar 2021
NOORAISYAH NABILAH
on 4 Mar 2021
Walter Roberson
on 11 Mar 2021
time = (0:length(val)-1)/Fs;
Here Fs needs to be the sampling frequency, in hertz (cycles per second.)
Nothing in the .mat file has information about the sampling frequency; you cannot deduce it from the data itself. You would need to find it as external information.
Categories
Find more on Time-Frequency Analysis 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!