MATLAB Answers

Find a value when it meets two conditions

1 ビュー (過去 30 日間)
Saad Alqahtani
Saad Alqahtani 2021 年 6 月 27 日
コメント済み: Saad Alqahtani 2021 年 7 月 1 日
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 件のコメント
Saad Alqahtani
Saad Alqahtani 2021 年 7 月 1 日
Thanks. That helps, although I might need to modify it a bit.

サインインしてコメントする。

回答 (0 件)

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by