Time dependent switch

141 ビュー (過去 30 日間)
Sampriti Bhattacharyya
Sampriti Bhattacharyya 2011 年 7 月 13 日
編集済み: Jyotishman 2024 年 11 月 4 日 13:47
I have a simulink model, and it has a clock. The model has many subsystems. I require to turn on a switch at a particular time of the simulation in one of the subsystems. How should I do that? (eg, at 10secs in that clock time (as it displays the time), I want the switch to act).
I initially put the time output into a workspace t. Then, I took a simple switch, where I put the control input as t, and mentioned the threshold. This would not work, since t is an array or struct.
Can anyone help?

回答 (1 件)

Seth Popinchalk
Seth Popinchalk 2011 年 7 月 13 日
Use the output of the Clock as the control signal for the switch. Then the threshold can be set to the time you would like it to switch. Specify Greater than the threshold or greater than or equal to to get the desired behavior.
If the switch is inside a subsystem and the clock is at the root of your model, you may need to add another inport to your subsystem to pass the signal into the subsystem.
Alternatively, the clock can be added to the subsystem and directly connected to the switch. The clock does not have to reside at the root of the model.
  3 件のコメント
janaka Amarasooriya
janaka Amarasooriya 2022 年 1 月 2 日
It worked, really thanks for the answer
Jyotishman
Jyotishman 2024 年 11 月 4 日 13:46
編集済み: Jyotishman 2024 年 11 月 4 日 13:47
If i want to connect this switch in parallel with a reasistor and a inductor, how can i connect?

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeSubsystems についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by