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 visualizaciones (últimos 30 días)
%%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 comentario
Geoff Hayes
Geoff Hayes el 16 de Dic. de 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.

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre MATLAB Coder en Help Center y File Exchange.

Productos


Versión

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by