I am currently trying to plot all the peaks of my data. Unfortunatley the last peak fails to be plotted using this function. It also happens to be the penultimate value in my data set so I'm not sure if this is where the problem is. It would be apprciated if someone could take a look and see if they can figure out where I am going wrong.
Thanks very much.
ECG = load('ECG.csv')Frequency = 350; %Frequency of ECG [Hz]
Time = (0:length(ECG)-1)/Frequency; %Number of samples divided by frquency
Amp = ECG(:,1); %ECG Amplitude
figureplot(Time,Amp)findpeaks(Amp,Time,'MinPeakProminence',100);[pks,locs] = findpeaks(Amp,Time,'MinPeakProminence',100);meanCycle = mean(diff(locs));BPM = 60/meanCycle;fprintf('%.2f', BPM)
Best Answer