Azzera filtri
Azzera filtri

Understanding which storage class is used

2 visualizzazioni (ultimi 30 giorni)
bert de Jong
bert de Jong il 31 Mar 2020
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?

Risposte (0)

Categorie

Scopri di più su Simulink Coder in Help Center e File Exchange

Prodotti


Release

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by