Creating a simulink signal with Boolean datatype

25 次查看(过去 30 天)
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 个)

类别

Help CenterFile Exchange 中查找有关 Sources 的更多信息

产品


版本

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by