How do I get signals to repeat to infinity?

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

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

Another simple suggestion: put an a sum Block after the signal builder block and add the result of the sum block with a delay of 30 seconds. Kinda like in my picture. (I only have 3 second delay since i need it repeated every 3 seconds)
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)

Products

Community Treasure Hunt

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

Start Hunting!