Creating a simulink signal with Boolean datatype
26 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Jeffrey
el 11 de Ag. de 2022
Respondida: Fangjun Jiang
el 12 de Ag. de 2022
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 comentarios
Respuesta aceptada
Fangjun Jiang
el 12 de Ag. de 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 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Sources en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!