I have a SIMULINK model that uses bus inputs and outputs as top level ports. When I am testing it, I don't know how to create a test signal as a bus and feed it into the model. I know that the straightforward way to do it is to create lots of individual signal and use bus creator
block to group those as a bus that will feed into the model. However, this may not be a very efficient way to do things. Does anyone know any alternative?
I tried to look into Mathworks website but nothing really came up. Any help would be appreciated.
If your test signal is constant the easiest way is to add a
Simulink
Constant
block and define the variable as a structure in some script .m file:Double-click on the
Constant
block, add the variable and then switch to theSignal Attributes
tab where you specify the data type to match your bus signal definition.