Find a value when it meets two conditions
14 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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
Réponses (0)
Voir également
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!