필터 지우기
필터 지우기

Understanding which storage class is used

조회 수: 2 (최근 30일)
bert de Jong
bert de Jong 2020년 3월 31일
I am trying to understand the bevaviour of the storage class assignment in Matlab.
Take the following example:
1. In the first scenario the storage class of 'lineSignal' is set to 'GetSet' and 'outputSignal' is set to 'auto'. This yields the following c-code:
/* Model step function */
void example_step(void)
{
/* (no output/update code required) */
}
/* Model initialize function */
void example_initialize(void)
{
/* ConstCode for Constant: '<Root>/Constant' */
set_lineSignal(1.0);
}
2. In the second scenario the storage class of 'lineSignal' is set to 'auto' and 'outputSignal' is set to 'GetSet'. This yields the following c-code:
/* Model step function */
void example_step(void)
{
/* (no output/update code required) */
}
/* Model initialize function */
void example_initialize(void)
{
/* (no initialization code required) */
}
3. In the third scenario the storage class of 'lineSignal' and 'outputSignal' are both set to 'GetSet'. This yields the following c-code:
/* Model step function */
void example_step(void)
{
/* (no output/update code required) */
}
/* Model initialize function */
void example_initialize(void)
{
/* ConstCode for Constant: '<Root>/Constant' */
set_lineSignal(1.0);
}
Based on this, I have two questions:
  1. Why is the initialization code not generated when the GetSet storage class is used on a port?
  2. Which storage class for which signal is used for code generation?

답변 (0개)

카테고리

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

제품


릴리스

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by