Is it possible to assign arrays with different length for LUT parameters in generated code than in Simulink?

조회 수: 1 (최근 30일)
Hi,
I intend to generate C-Code out of my simulink model using Simulink Coder (ert.tlc). I wish to tune certain parameters of simulink model and for this reason, i have created simulink objects with "ImportedExternPointer" storage class.
While compiling and generating the code, the length of arrays for breakpoint and table data of a particular lookup table was 15000. I wish to tune these parameters, not just by the values, but also by the length of these arrays. I hoped that defining them as pointers would allow me to do so. However in the code, the function for lookup table looks as follows
real_T look1_bftfId_binlagpw(real_T u0, const real32_T bp0[], const real32_T
table[], uint32_T maxIndex)
and correspondingly, the code snippet for the relevant lookup table is as below.
look1_bftfId_binlagpw
(InputSignal->Timing.t[0], BreakpointData,
TableData, 15000U)
Is there a way to remove this restriction and give different sized array as inputs?
Thanks and best regards,
Karthik

채택된 답변

Nick Sarnie
Nick Sarnie 2019년 6월 28일
편집: Nick Sarnie 2019년 7월 1일
Edit: See below response
  댓글 수: 1
Karthik  Vemireddy
Karthik Vemireddy 2019년 7월 1일
Hi,
upon looking up the documentation again, i have found the following:
Based on it, i have chosen the following options
LUTSnapshot.PNG
and then the defined the MaxIdx as dataobject.... The generated code now has :
real_T look1_bftfId_binlagpw(real_T u0, const real32_T bp0[], const real32_T
table[], uint32_T maxIndex)
and the relevant LUT Code is as follows:
rtb_Saturation_c = look1_bftfId_binlagpw(rtb_alpha_y, BreakpointData,
TableData, *MaxIdx);
It had replaced the upperlimit with relevant variables at all the required places...
For the cases, that i have tested till now, it works :)
Best R'gds
Karthik

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Simulink Coder에 대해 자세히 알아보기

제품


릴리스

R2017b

Community Treasure Hunt

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

Start Hunting!

Translated by