Switch block need help

3 ビュー (過去 30 日間)
Adham
Adham 2014 年 8 月 4 日
回答済み: Adham 2014 年 8 月 8 日
Could anyone please describe this block for me and especially the control port I didn't understand it even after reading the help.
thx
  2 件のコメント
Geoff Hayes
Geoff Hayes 2014 年 8 月 4 日
Adham - no block was included in your question.
Adham
Adham 2014 年 8 月 5 日
The switch block in simulink : Simulink library browser then HDL Coder then Commonly used blocks then switch

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

採用された回答

Christopher Berry
Christopher Berry 2014 年 8 月 7 日
Adham,
The documentation for this block is a bit confusing. Think of it as an if-else, which may make more sense if you have a computer science background.
Something like this:
if (cond == TRUE)
output = u1 %Input port 1
else
output = u3 %Input port 3
end
Where cond can be any of the following 3 choices:
1. cond = u2 >= Threshold
2. cond = u2 > Threshold
3. cond = u2 ~= 0
So the output of the block will be either input 1 or input 2 depending on the value of input 2, the type of condition selected and the value of threshold selected.
Hope that helps some!

その他の回答 (1 件)

Adham
Adham 2014 年 8 月 8 日
Thanks, that was helpful

カテゴリ

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

製品

Community Treasure Hunt

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

Start Hunting!

Translated by