Generate arbitrarily shaped periodic signal
The Repeating Sequence block outputs a periodic scalar signal having a waveform that you specify using the Time values and Output values parameters. The Time values parameter specifies a vector of output times. The Output values parameter specifies a vector of signal amplitudes at the corresponding output times. Together, the two parameters specify a sampling of the output waveform at points measured from the beginning of the interval over which the waveform repeats (the period of the signal).
By default, both parameters are [0 2]. These default settings specify a sawtooth waveform that repeats every 2 seconds from the start of the simulation and has a maximum amplitude of 2.
The block sets the input period as the difference between the first and last value of the Time values parameter. The output at any time t is the output at time t = t-n*period, where n is an integer. The sequence repeats at t = n*period. The block uses linear interpolation to compute the value of the waveform between the output times that you specify.
For the Repeating Sequence block:
The input period is 0.5.
The output at any time t is the output at time t = t-0.5n, where n = 0, 1, 2, and so on.
The sequence repeats at t = 0.5n, where n = 0, 1, 2, and so on.
When you run the model, you get the following results:
At t = 0.5, the expected output is equal to the output at t = 0, which is 0. Therefore, the last value in the Output values vector [0 15 25 09 13 17] does not appear.
The Repeating Sequence block outputs real signals of type double.
For more information, see Data Types Supported by Simulink in the Simulink® documentation.
The following Simulink examples show how to use the Repeating Sequence block: