0
votes

I need to make a Simulink block which receives a concatenation of a number of bus signals and performs the same math operations on the signals contained in the bus for each pair of consequent buses. The bus signals are of the same type and are non-virtual.

For the sake of the question, let's assume to have a concatenation of 4 simple buses, each containing a x and a y field. A bus of signals composed of a=x1+x2 and b=y1-y2 need to be made out of buses inputs 1,2 and 3,4. So, the output of the block should be a concatenation of 2 buses, the first containing information from the first pair of input buses, and the second one from the second pair.

An hard-to-scale way to do it is the following.

Example of implementation

Are there any built-in Buses Math operations possibilities, or better ways to implement this? I could not find anything in Mathworks documentation, and simple operations block generate incompatibility errors.

1
You don't want to use MATLAB function and do this operations into it's body?Mikhail_Sam
@Mikhail_Sam, I would actually prefer to maintain the project as 'graphical' as possible, to be able to show print-outs and discuss them with colleagues. I'll consider this option at last anyway. Thanks for the inputraggot

1 Answers

2
votes

You need to use For Each Subsystem Block. As shown in this example. Note that I called the bus BusTest and made the dimension and datatype of signals visible:

enter image description here

Now set the Signal Width parameter of that block to two so it divides input array into chunks of length 2:

enter image description here

Then move your logic into that block:

enter image description here