Importing vector from workspace to simulink then conditionally use them (Communication related)

1 view (last 30 days)
Hello, I am currently working on a communication link simulation.
I need to import some pre-defined vector from workspace and I need to simulate it going around a link with some error channel.
I was able to use "Signal From Workspace" block to import the vector to Simulink with no difficulty.
However, my problem is the vector must be sent conditionally, that is on the other side of simulation, there is a
system that I built which calculates the number of error in the vector; according to this result, my vector must be
either be refrained from transmitting or resumed to transmitting.
For some reason, I couldn't figure out which blocks to use and how to approach it.
Any help would be equally valuable!
Thanks

Accepted Answer

Jacob Halbrooks
Jacob Halbrooks on 27 Dec 2013
I would first suggest the Switch block in the Simulink Signal Routing library. This would allow you to switch between two signals (one being the workspace vector) based on a control port, which you could feed using the number of errors.
If the Switch block is not adequate, considering an Enabled or Triggered Subsystem from the Simulink Ports & Subsystems library. These would allow you to define a conditionally executed subsystem based on the number of errors as the control or trigger.

More Answers (0)

Products

Community Treasure Hunt

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

Start Hunting!