How to convert a 1x1 struct to double matrix (error using pan tompkin)?
Afficher commentaires plus anciens
I'm trying to use Pan Tompkins code to detect QRS from ECG signal, and I'm facing a problem, the code defines ecg as vector, but there's part of the code function that uses this line:
ecg_h = filtfilt(a,b,ecg);
But ecg has to be a double matrix for filtfilt function to work. I tried loading the signal before defining it as ecg because it gets loaded as double matrix, but that didn't work, I kept getting undevined variable error.
% Load data
ecg=load('ECGdata.mat');
fs = 500; % Sampling frequency
t = (0:length(ecg)-1) /fs;
gr=1;
QRS=pan_tompkin(ecg,fs,gr);
3 commentaires
Image Analyst
le 1 Juin 2024
Take the semicolon off the load statement and tell us what you see in the command window. Or better yet, attach the mat file.
If you have any more questions, then attach your data with the paperclip icon after you read this:
Student
le 1 Juin 2024
Student
le 2 Juin 2024
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Multirate Signal Processing dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

