how to run an index loop while using find function
이전 댓글 표시
I have two sets of (time) array. By using the time of red mark(ECG) as indicated in the picture. I'm trying to sweep to the right by fixed range (peakgap) to find the blue mark by using find function with condition RpeakTime<PPG1peakTime<PPG1peakTime+peakgap.
I'm trying to figure it out to use find function with index loop. How can I get the answer data of every red plot in array using for loop.
this is my code but I know it does not work
PPG1Psize = numel(PPG1peakTime);
peakgap = ((PPG1Psize)/(3*tend)); %estimate delay time between each ECG peak
for j=1:numECG
[rows,columns] = find(PPG1peakTime>RpeakTime(i) & PPG1peakTime<(RpeakTime(i)+peakgap));
end

댓글 수: 6
Star Strider
2019년 11월 10일
Use the findpeaks (or islocalmax) function to get the peaks and locations of each vector separately (EKG & PPG). Then you can get the relevant time differences from those results.
This would be much easier with your data (individual time vectors and corresponding EKG and PPG values).
Tipnirin Vajanarat
2019년 11월 10일
편집: Tipnirin Vajanarat
2019년 11월 10일
Star Strider
2019년 11월 10일
My pleasure.
There are several ways to correct a wandering baseline (the easiest in my opinion is to use a highpass filter, or bandpass filter to also remove high-frequency noise).
I cannot help you unless I have a representative sample of your data.
Tipnirin Vajanarat
2019년 11월 10일
Image Analyst
2019년 11월 10일
Did you see the last sentence of Star's comment?
Tipnirin Vajanarat
2019년 11월 11일
편집: Tipnirin Vajanarat
2019년 11월 11일
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Descriptive Statistics에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
