Double condition to find index
Show older comments
I have force data from force plate and I try to determine the impact time/index.
For that, I need two conditions:
1) Data exceeds 20 newtons (>20)
2) Data exceeds 20 newtons for more than 50 milliseconds
I tried with for + if and with for using find fonction.
Do you have some idea to resolve that ?
Thank you so much.
3 Comments
James Tursa
on 24 Jun 2022
What is the sampling rate of your recorded data?
Jeanne Dury
on 24 Jun 2022
Accepted Answer
More Answers (1)
Jonas
on 24 Jun 2022
myData=...;
fs=2000;
minLength=ceil(fs*0.05);
highVals=myData>20;
searchFor=conv(highVals,ones(1,minLength),'same');
% areas in which the condition is fullfilled are greater than your minLength
plot(searchFor);
findpeaks(searchFor>=minLength)
Categories
Find more on Signal Integrity Kits for Industry Standards in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!