How can I rename signals in a bus in Simulink 7.4 (R2009b)?

13 views (last 30 days)
I would like to connect multiple blocks that use buses as inputs and outputs. However the names of the signals in the bus that comes out of one block do not match the names of the signals in the other block. I would like to know if there is an easy way to create an interface between both blocks that 'renames' the signals in the buses instead of extracting all signals from the bus and constructing a new bus from it.

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 8 Jan 2010
It is possible to create such an interface using an Embedded MATLAB block and a Simulink.Bus object. The Embedded MATLAB block can be used to copy its input to its output, while the structure of the output is determined by the Simulink.Bus object. As an example, load the attached file "my_bus_signals.mat" and run the attached model. You will notice that the signals a, b and c and renamed to d, e and f
  1 Comment
Eeshan Mitra
Eeshan Mitra on 24 Apr 2018

If you are referring to the script within the MATLAB Function block (as it is called in present releases), its just the default, i.e:

function y = fcn(u)
%#eml
y=u;

Sign in to comment.

More Answers (0)

Products


Release

R2009b

Community Treasure Hunt

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

Start Hunting!