MATLAB: How to make a Signal Builder block in Simulink start from t = 0 when the simulation time is not t = 0

blockbuilderenableenabledsignalsimulinksubsystemtriggered

How do I make a Signal Builder block in Simulink start from t = 0 when the simulation time is not t = 0?
I would like to use a Signal Builder block to generate a signal from within an enabled subsystem. I would like the Signal Builder block to start at t=0 when the block is enabled though. Currently, when the Signal Builder block is enabled at, say t = 5 seconds, the Signal Builder block starts out partway through the sequence I constructed. Is there a way to make this start at t=0 whenever the subsystem is enabled? Is there an alternate way to do this?

Best Answer

The ability to make the Signal Builder block start from t = 0 when it is enabled and the simulation time is not t = 0 is currently not available in Simulink. This is a limitation of all Simulink sources, not just the Signal Builder block.
Currently, to work around this issue, you can manually construct a solution in a similar manner as follows:
1. Export the Signal Builder data to the workspace (File\Export to Workspace) and save it to a .mat file
2. Use the data as parameters in a lookup table block.
3. In the enabled subsystem use an integrator with resettable states fed by a constant 1 to record the time since the block was enabled.
4. Feed the integrator output into the lookup table block.
Related Question