Borrar filtros
Borrar filtros

C++ S-Function DYNAMICALLY_SIZED only known after mdlStart

2 visualizaciones (últimos 30 días)
Is there a way to set the Input-/Outputports during mdlStart? My Problem is that i am creating an instance of an object during the mdlStart function, and until this point I can't be sure about the size of my output signal.
Of course i could already create a dummy object during mdlInitializeSizes and free the Memory at the end of the function, but this would mean quite an overhead every time this function is called.
Is there any way I could avoid this? The examples from the helpfile did not help me as this example use parameters from simulink, which are already available during the call to mdlInitializeSizes.
Thanks for helping.

Respuesta aceptada

Kaustubha Govind
Kaustubha Govind el 10 de Abr. de 2013
Unfortunately, no, the Simulink Engine allocates memory for the input and output signals in time for mdlStart, so the S-function needs to specify the number/size of the inputs and outputs before mdlStart.

Más respuestas (0)

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by