MATLAB Answers


Find HR from ECG.

Asked by Kasper
on 12 Apr 2011
Hi. I am looking for help, at finding the HR from a ECG signal. The ECG file is imported to Matlab and I have used "findpeaks", to find the R-wave. My question is: how do I find the x-values (time) corresponding to the y-values (mV)? Hope you understand the question.


Sign in to comment.

1 Answer

Answer by Jarrod Rivituso on 12 Apr 2011
 Accepted Answer

If you are using findpeaks, you should be able to get the indices as well.
>> x = 0:0.01:4*pi;
>> y = sin(x);
>> [yMax,idx] = findpeaks(y);
>> x(idx)

  1 Comment

on 12 Apr 2011
Thank you very much! That made it work!

Sign in to comment.