How to use signal name as variable name in generated code

조회 수: 8 (최근 30일)
Andrea Carignano
Andrea Carignano 2025년 12월 17일 22:37
편집: Andrea Carignano 2025년 12월 17일 22:38
I have a simple model with an atomic subsystem block.
the signal after the subsystem "Function" is called "x" in the model.
The generated code for the step function is
void untitled1_step(void)
{
real32_T rtb_Gain;
/* Outputs for Atomic SubSystem: '<Root>/Function' */
/* Inport: '<Root>/In1' */
rtb_Gain = untitled1_Function(untitled1_U.In1);
/* End of Outputs for SubSystem: '<Root>/Function' */
/* Outport: '<Root>/Out2' incorporates:
* Bias: '<Root>/Bias'
*/
untitled1_Y.Out2 = rtb_Gain + 2.0F;
}
Embedded coder generate rtb_Gain variable.
However I would like to generate the x variable instead, so that the code became:
void untitled1_step(void)
{
real32_T rtb_Gain;
/* Outputs for Atomic SubSystem: '<Root>/Function' */
/* Inport: '<Root>/In1' */
x = untitled1_Function(untitled1_U.In1);
/* End of Outputs for SubSystem: '<Root>/Function' */
/* Outport: '<Root>/Out2' incorporates:
* Bias: '<Root>/Bias'
*/
untitled1_Y.Out2 = rtb_Gain + 2.0F;
}
Is there any general setting that I can activate to do this?

답변 (0개)

카테고리

Help CenterFile Exchange에서 Deployment, Integration, and Supported Hardware에 대해 자세히 알아보기

제품


릴리스

R2025a

Community Treasure Hunt

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

Start Hunting!

Translated by