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 个)
Kaustubha Govind
2013-6-14
0 个投票
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.
类别
在 帮助中心 和 File Exchange 中查找有关 Signal Attributes and Indexing 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!