Find a value when it meets two conditions

14 vues (au cours des 30 derniers jours)
Saad Alqahtani
Saad Alqahtani le 27 Juin 2021
Commenté : Saad Alqahtani le 1 Juil 2021
Hi,
I'm trying to find a specific value in an array when it meets two conditions (1- as soon as it occur the first time, 2- if its longer than 2 seconds), then, I want the code to stop and give me the length from the beginng to that value that mets both conditions. Here is my code:
t= (2*2048);
for i = 1:length (M)
if W = find ((M >=5) & i > t)
break
W = length(i);
end
end
Thanks in advance for the help.
  4 commentaires
Saad Alqahtani
Saad Alqahtani le 1 Juil 2021
Thanks. That helps, although I might need to modify it a bit.

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur Logical dans Help Center et File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by