Here is the processed text with the code fragment restored and formatted:
Problem.
I am trying to find peaks of whole Curve or graph or ECG ... but i dont know why in my code show peaks in y vector, while i need it in whole of ecg
If someone could point me in the right direction it would be greatly appreciated.
x = load ('C:\ekg\example_ecg.txt');
y = x ( :, 2);
[pks,locs] = findpeaks(y);
plot (y);
hold on ;
plot(pks,y(locs),'rv','MarkerFaceColor','r');
grid onSolution.
You should replace plot(pks, y(locs), 'rv', 'MarkerFaceColor', 'r') with replace plot(locs, pks, 'rv', 'MarkerFaceColor', 'r'), as first argument of plot is x-coordinate and second argument is y-coordinate.
www.AssignmentExpert.com
Comments