Intialization of local variables in model_step() function
이전 댓글 표시
Is it possible to initialize the local variables (with zero or with any value) in model_step() function in the code generated by Embedded coder ?
I am using R2011b.
I want code to generated like this.
void model_step()
{
boolean_T rtbxyz = 0;
uint8_T rtbklm[2] = {0,0};
/* Model logic */
}
I gone through the code generation settings but not found any way.
댓글 수: 1
Namrata Biranje
2020년 4월 16일
I am facing the same issue.Is there any solution or do I need to contact technical team of Mathworks?
답변 (1개)
Kaustubha Govind
2012년 10월 29일
0 개 추천
What block generates the code that uses these variables? The block is responsible for initialization of these variables. If it is an S-function block, it's TLC file might need fixing. If it is a shipped Simulink library block, uninitialized variables should be considered a bug.
댓글 수: 4
Kaustubha Govind
2012년 10월 29일
TAB: I've usually seen such variables initialized before use (even if not initialization at declaration) - does that not happen in this case? If so, I would recommend reporting this to MathWorks Technical Support. Thanks!
Kaustubha Govind
2012년 10월 29일
TAB: Please report this as a bug to MathWorks Support. Hopefully they will also provide a workaround for you.
카테고리
도움말 센터 및 File Exchange에서 AUTOSAR Blockset에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!