How can I group a number of similar Simulink Outports so that Embedded Coder will define them as an array of variables in the resultant C code?

1 次查看(过去 30 天)
I have a Simulink model which has 30 signals named testPoint1 to testPoint30 connected to Outport blocks. Embedded Coder accordingly creates 30 variables of type volatile int32_T in the corresponding C code. Instead of this, I would like an array of variables to be created, named testPoint[]. Can anyone advise me how to achieve this, please.

采纳的回答

Mark McBroom
Mark McBroom 2020-1-25
As long as all signals are of the same type, you can merge them together into a vector using the vector concatenate block. https://www.mathworks.com/help/simulink/slref/vectorconcatenate.html
  1 个评论
Peter Davies
Peter Davies 2020-1-27
Many thanks, Mark, for your answer, it is much appreciated. I had tried this method at one point, but obviously had not set all the properties correctly. Knowing that this is the way to go meant I was able to persevere and I now have an exported global array of variables.

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 String 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by