I'm using Embedded Coder. Is there a way to configure the code generation process so that the dimensions of an input signal can be set at run time?

3 次查看(过去 30 天)
The general workflow here is to use variable size signals from a selector where the upper bound of the variable size signal is explicity set.
However, I'm autogenerating a signal representing an image (960x1280) in an application where memory management is critical. The selected signal is very often only a small subset of the maximum signal size and only needs to be set prior to initialization. A variable sized signal would result in the upper bound 960x1280 signal being propogated through my model. Where as, what I would call a configurable run-time parameter could allocate just the memory that is required at initialization. The work flow would then be as follows, If the image size selection is changed then the code would be terminated and re-initialized with the new dimensions. Is there a way to setup the code generation process to support this workflow?
I will also point out that dynamic memory application is not an acceptable solution for our application.

回答(1 个)

Nick Sarnie
Nick Sarnie 2018-11-17
编辑:Nick Sarnie 2018-11-17
Hi David,
Variable size signals are meant for signals that will change size during the execution of the model. It sounds like the size of your signals will be constant once the model starts, but will change betweens runs of the model.
You may want to investigate into Symbolic Dimensions. You can find an example below:
Thanks,
Nick
  1 个评论
David Grosher
David Grosher 2018-11-19
Yes, I had already started looking at Symbolic Dimensions and I had worked through that demonstration. The major issue though is that there are very few blocks that support this feature. Matlab functions for example only work in for loops where data is explicitely accessed. As I mentioned, I'm using an image, meaning that each element of the matrix is related to the elements near it, It does not seem obvious to me how to access the full matrix for use inside of matlab functions or with the computer vision toolbox. I don't see how this feature wouldn't require an almost complete rewrite of all of that code.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Deployment, Integration, and Supported Hardware 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by