Composite Signal to MATLAB Function Block

I have an output bus that contains 1-D and 2-D signals. I need to feed that bus to real-time software that only accepts 1-D signals. How can I first determine which signals are 2-D and then reshape the 2-D signals into a 1-D array? Since the MATLAB Function block does not accept 2-D signals, I cannot think of another way to approach this issue. The obvious answer would be to decompose the bus with a bus selector/demux but this particular bus contains a large amount of signals - enough to strongly discourage the use of a signal routing block. (2012b)

回答(1 个)

I presume you are using the (Interpreted) MATLAB Function block. You can use the (Embedded) MATLAB Function block with bus signals, as long as they are non-virtual buses. Please see Attach Bus Signals to MATLAB Function Blocks. You will need to create Simulink.Bus objects for both input and output structure types.

产品

提问:

2013-6-7

Community Treasure Hunt

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

Start Hunting!

Translated by