How to debug the error in Pan Tompkins Algorithm?

While trying to execute the Pan Tompkins Code which was downloaded from the Mathworks, following error was encountered:
Error using pan_tompkin (line 118) Not enough input arguments.

 채택된 답변

Walter Roberson
Walter Roberson 2016년 3월 15일

0 개 추천

You would get that error if you did not pass at least two arguments to the routine when you called it. You must pass at least the ecg data and the fs.

댓글 수: 5

Sir, what are the steps to pass the arguments to routine in the above pan tompkins code?
pan_tompkin(ecg,fs,gr) is a function
ecg,fs,gr are arguments
To pass arguments mean to assign values to ecg, fs and gr.
ecg is ElectroCardioGram signal
fs is sampling frequency
gr is a flag to plot or not plot (set it 1 to have a plot or set it zero not to see any plots
Steps:
ecg = load('ECG_sample_noisy.mat');
fs= 256;
gr=1;
pan_tompkin(ecg,fs,gr) % To call function
Oh ok. Thanku so much, it did help. But again I am getting the error regarding arguments as below:
Error using plot Not enough input arguments.
Error in pan_tompkin (line 157) figure, ax(1)=subplot(3,2,[1 2]);plot(ecg);axis tight;title('Raw ECG Signal');
datacell = load('ECG_sample_noisy.mat');
fn = fieldnames(datacell);
ecg = datacell.(fn{1});
fs = 256;
gr = 1;
pan_tompkin(eg, fs, gr)
That is, you have to pass a particular variable from the .mat file. If you knew the name of the variable, such as by using
whos -file ECG_sample_noisy.mat
then you could work more directly. For example if the variable name was "Slithey_Toove' then you could use
datacell = load('ECG_sample_noisy.mat');
ecg = datacell.Slithey_Toove;
fs = 256;
gr = 1;
pan_tompkin(eg, fs, gr)
hello walter..i am having this error while calling pan_tompkin.m i am new to matlab..i don't know where to make changes,can you help me ?

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

추가 답변 (1개)

Shraddha Joshi
Shraddha Joshi 2016년 3월 16일

0 개 추천

Thank you Sir!!!

댓글 수: 1

Sir, I have recently started working on Atrial Fibrillation(AF) related project. I have downloaded a few MIT_BIH AF signals from physionet.com. Could u just tell me as to how to pass these signals one by one in the Pan Tompkins Algorithm Code? Hope to get the help at the earliest!!

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

카테고리

도움말 센터File Exchange에서 MATLAB Mobile에 대해 자세히 알아보기

태그

질문:

2016년 3월 15일

댓글:

2018년 6월 19일

Community Treasure Hunt

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

Start Hunting!

Translated by