Effacer les filtres
Effacer les filtres

Understanding which storage class is used

2 vues (au cours des 30 derniers jours)
bert de Jong
bert de Jong le 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?

Réponses (0)

Catégories

En savoir plus sur Simulink Coder dans Help Center et File Exchange

Produits


Version

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by