How do I get signals to repeat to infinity?

13 views (last 30 days)
Good morning.
I have the following signals in the Signal Builder block in Simulink. These signals need to be timed as shown, and I need this 30 second sequence to repeat as long as the program is running. How can this be done?
Running Matlab R2012b.
Thanks.

Accepted Answer

Swarooph
Swarooph on 26 Jul 2016
I don't think this can be done using the Signal Builder block. It has only 3 options to set after final time. 'Hold final value', 'Set to Zero' or 'Extrapolate'. (File --> Simulation Options). You can instead try to use a 'Repeating Sequence' block.
  • Export data from Signal Builder to Workspace. (File --> Export to Workspace). For this example keep the variable name as channels.
  • Now your time data is specified by variables such as
channels(1).xData
channels(2).xData
.
.
.
channels(n).xData
  • Your signal data is specified by variables such as
channels(1).yData
channels(2).yData
.
.
.
channels(n).yData
  • Use a repeating sequence block and set Time Values and Output Values appropriately. You will have as many blocks as signals.
  • If you are planning on doing something like this quite often, you could create a masked subsystem that takes the entire channels variable and redistribute it to several programmatically created Repeating Sequence blocks underneath.
  3 Comments
Abderrahmane GHIMOUZ
Abderrahmane GHIMOUZ on 4 Jan 2018
Hi, is it possible to show me the parameters of the delay block you used ? Thank you in advance

Sign in to comment.

More Answers (1)

Rodrigo Prat
Rodrigo Prat on 20 Jun 2020
Michael you are a genious

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!