Using clock as logic operator

I need to control the movement of linear actuator to move in, wait 30 minutes, then move out, wait 30 minutes, and repeat. Specifically, I want to somehow output 0 or 1 depending on the time. For instance, I need an output of 1 for the first 30 minutes, 0 for 30-60 minutes, 1 for 60-90 minutes, 0 for 90-120 minutes, and so forth. How can I use the clock as a logic operator like this?
THANKS

 採用された回答

TAB
TAB 2012 年 4 月 10 日

2 投票

Instead of clock, you can use Sources/Pulse Generator block. Set the Period & Pulse width of pulse generator according to your requirement. Type-cast the pulse generator output to boolean before feeding to outport.

その他の回答 (0 件)

カテゴリ

タグ

質問済み:

2012 年 4 月 10 日

Community Treasure Hunt

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

Start Hunting!

Translated by