Variable-Size Signal Length Adaptation
This example shows a hypothetical system where the length of a signal changes over time by adapting to the changes of a control signal.
Open and compile the model named sldemo_varsize_dataLengthAdapt
.
This model corresponds to a hypothetical system in which the length of a signal is adapted over time. At any given point in time, the size selection subsystem sets the signal length to three, six, or nine elements based upon the range into which the control signal value falls.
This model consists of two sections:
The left section generates a signal and converts the signal to variable size.
The right section processes the variable-size signal and outputs the signal to a scope.
Length adaptation is based on the value of the control signal. When the control signal falls within one of the three predefined ranges, the size of the data signal changes accordingly.
This variable-size signal is then fed into a processing block, where blocks that support variable-size signals operate on the signal. Note the application of a MATLAB Function block with both the input and the output signals of variable-size. The resulting signal and the signal width are fed to a scope for visualization.
For a fixed-size implementation, open and compile the model named sldemo_varsize_dataLengthAdtFS
.
In this model, each different signal size requires a dedicated processing block, resulting in block duplication.