How do track a video and make the alarm run after 10 s the occurrence of a condition, but after making sure that the condition is still happen without off displaying?

2 Ansichten (letzte 30 Tage)
%%need to catch CL and then check if still CL there run alarm or do check again without pause or stop the displaying:
%%the two code does't working well where the alarm is run but the displaying is pause
out = (labels);
out = out(1,1)
first code :
% initTime = clock;
% newTime = initTime;
% for out='CL'
% if newTime(6)-initTime(6)==10
% [a,fs] = audioread ('1003.wav');
% sound(a(1:100000),fs);
%
%
% end
% newTime = clock;
% end
secounde code:
if out == 'CL'
tic;
pause (10);
if out == 'CL'
[a,fs] = audioread ('1003.wav');
sound(a(1:100000),fs);
elseif out ~= 'CL'
reset(tic);
end
end
  1 Kommentar
Geoff Hayes
Geoff Hayes am 16 Dez. 2021
@abubaker alasfer - how is the condition determined? How is out determined? If on the first occurrence of out being "CL", then you could start a ten second timer to see that if, after the timer expires, that "CL" is still true, then sound the alarm.
Note when comparing strings you will get errors when using ==. You should be using strcmp or strcmpi instead.

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Kategorien

Mehr zu MATLAB Coder finden Sie in Help Center und File Exchange

Produkte


Version

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by