How to add a time delay using FOR and IF loop for logical vectors?

1 次查看(过去 30 天)
Hi,
I have a logical vector which is from the output of a motion sensor "Motion_1" used in an experiment. it is "1" if motion is detected and "0" if no motion is detected. I want to create a process for where I can model different time delays. for this is have created a logical vector of all "1" "Five_min_delay" which equate to five minutes from my experiment. The trouble I am having is I want to scan through the "Motion_1" vector and when it becomes high "1" I want to add the "Five_min_delay" into it so this simulates the sensor being "1" for five minutes. As well as this I need to re-trigger the time delay every time "Motion_1" becomes High "1" within that time delay. I hope this makes sense? does anyone have an appropriate solution to this? Please query any of my question if not fully understood. Thanks in advance, Adam

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 MATLAB 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by