필터 지우기
필터 지우기

C++ S-Function DYNAMICALLY_SIZED only known after mdlStart

조회 수: 2 (최근 30일)
Friedrich
Friedrich 2013년 4월 9일
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.

채택된 답변

Kaustubha Govind
Kaustubha Govind 2013년 4월 10일
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.

추가 답변 (0개)

제품

Community Treasure Hunt

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

Start Hunting!

Translated by