Filter löschen
Filter löschen

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

1 Ansicht (letzte 30 Tage)
Adam Johnson
Adam Johnson am 12 Apr. 2018
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

Antworten (0)

Kategorien

Mehr zu MATLAB finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by