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 visualizaciones (últimos 30 días)
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.

Respuestas (1)

Nick Sarnie
Nick Sarnie el 17 de Nov. de 2018
Editada: Nick Sarnie el 17 de Nov. de 2018
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 comentario
David Grosher
David Grosher el 19 de Nov. de 2018
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.

Iniciar sesión para comentar.

Categorías

Más información sobre Deployment, Integration, and Supported Hardware en Help Center y File Exchange.

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by