Creating a simulink signal with Boolean datatype
21 views (last 30 days)
Show older comments
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).
0 Comments
Accepted Answer
Fangjun Jiang
on 12 Aug 2022
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 Comments
More Answers (0)
See Also
Categories
Find more on Sources in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!