Creating a simulink signal with Boolean datatype

6 ビュー (過去 30 日間)
Jeffrey
Jeffrey 2022 年 8 月 11 日
回答済み: Fangjun Jiang 2022 年 8 月 12 日
I am very new to working with Simulink, so I apologize if this is a very basic question that am not getting. I built a subsystem structure and there are a few signals that are of Boolean datatype. True = 1 and False = 0. This signal will go into a switch block along with a constant to determine the output signal.
Is the True/False handled in the switch block or is there something I need to do with the input signal in order to have this switch properly executed? Is there a script that can be produced to handle this type of signal?
I have attached a snip of the structure with a signal (and dialog box for the signal).

採用された回答

Fangjun Jiang
Fangjun Jiang 2022 年 8 月 12 日
What you did is correct. However, it may cause error if the incoming signal connected to the Inport block "In8" is not boolean. You can do further specification on that signal to resolve the error. But since you are new, the best way is to use the default setting and don't specify too much for now.
Delete the "In8" Inport block and drag a new one from the library, continue developing your model and run simulation. Ask help if you encounter some issuses that you can't resolve.

その他の回答 (0 件)

カテゴリ

Find more on Schedule Model Components in Help Center and File Exchange

製品


リリース

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by