If you have a list of times, you can configure the Time-Based Entity Generator block to generate entities at these times. Explicit entity-generation times are useful if you want to
Recreate an earlier simulation whose intergeneration times you saved using a Discrete Event Signal to Workspace block.
Study the behavior of your model under unusual circumstances and have created a series of entity generation times that you expect to produce unusual circumstances.
Verify simulation behavior that you or someone else observed elsewhere, such as a result reported in a paper.
To generate entities at specified times, follow this procedure:
In the Time-Based Entity Generator block,
set the Generate entities with parameter to
time from port t. A signal input port labeled t appears
on the block.
Depending on whether or not you want to generate an entity at T=0, either select or clear the Generate entity at simulation start option.
Create a column vector,
0 followed by the nonzero times at which
you want to create entities, in strictly ascending order. You can
create this vector using one of these techniques:
Enter the definition in the MATLAB® Command Window
Load a MAT-file that you previously created
Manipulate a variable that a To Workspace block or Discrete Event Signal to Workspace block previously created
An example of a column vector listing generation times is:
gentimes = [0; 0.9; 1.7; 3.8; 3.9; 6];
to the vector of generation times, thus creating a vector of intergeneration
intergentimes = diff(gentimes);
Insert an Event-Based Sequence block in the model and connect it to the t input port of the Time-Based Entity Generator block.
In the Event-Based Sequence block,
set Vector of output values to
Set the Form output after final data value by parameter
Setting to infinity. The
to infinity option halts the generation process if the
simulation time exceeds your maximum generation time.