0
0
Simulinkdata~10 mins

Why code generation bridges model to embedded deployment in Simulink - Test Your Understanding

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to generate C code from a Simulink model.

Simulink
rtwbuild('[1]')
Drag options to blanks, or click blank then click option'
Asim('myModel')
BmyModel
Cload_system('myModel')
Dsave_system('myModel')
Attempts:
3 left
💡 Hint
Common Mistakes
Using simulation commands instead of code generation commands.
Passing the wrong argument type to rtwbuild.
2fill in blank
medium

Complete the code to set the system target file for embedded code generation.

Simulink
set_param('[1]', 'SystemTargetFile', '[2]')
Drag options to blanks, or click blank then click option'
AmyModel
Bert.tlc
Cgrt.tlc
Dsim.tlc
Attempts:
3 left
💡 Hint
Common Mistakes
Using the wrong target file for embedded deployment.
Not specifying the model name correctly.
3fill in blank
hard

Fix the error in the code to generate code and build the model.

Simulink
rtwbuild([1])
Drag options to blanks, or click blank then click option'
AmyModel()
B'myModel'
C"myModel"
DmyModel
Attempts:
3 left
💡 Hint
Common Mistakes
Passing the model name as a variable instead of a string.
Using double quotes which may cause issues in some contexts.
4fill in blank
hard

Fill both blanks to configure the model for code generation and build it.

Simulink
set_param('[1]', 'GenerateCodeOnly', '[2]');
rtwbuild('[3]')
Drag options to blanks, or click blank then click option'
AmyModel
Bon
Coff
Dtrue
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'on' instead of 'off' for GenerateCodeOnly.
Using different model names in the two commands.
5fill in blank
hard

Fill all three blanks to create a code generation report and open it after building.

Simulink
set_param('[1]', 'GenerateReport', '[2]');
rtwbuild('[1]');
rptview('[1]')
Drag options to blanks, or click blank then click option'
AmyModel
Bon
Coff
DmyModel_report
Attempts:
3 left
💡 Hint
Common Mistakes
Not enabling report generation before building.
Using the wrong command to open the report.