0
0
Simulinkdata~10 mins

Model-based development workflow in Simulink - Interactive Code Practice

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

Complete the code to start the model simulation.

Simulink
sim('[1]')
Drag options to blanks, or click blank then click option'
ArunSim
BstartModel
Cexecute
DmyModel
Attempts:
3 left
💡 Hint
Common Mistakes
Using a function name instead of the model name.
Not putting the model name in quotes.
2fill in blank
medium

Complete the code to load the Simulink model into memory.

Simulink
load_system('[1]')
Drag options to blanks, or click blank then click option'
AstartModel
BrunSim
CmyModel
Dexecute
Attempts:
3 left
💡 Hint
Common Mistakes
Using a function name instead of the model name.
Not using quotes around the model name.
3fill in blank
hard

Fix the error in the code to save the model after changes.

Simulink
save_system('[1]')
Drag options to blanks, or click blank then click option'
AmyModel
BrunSim
Cexecute
DstartModel
Attempts:
3 left
💡 Hint
Common Mistakes
Trying to save with a function name instead of the model name.
Forgetting to put the model name in quotes.
4fill in blank
hard

Fill both blanks to create a dictionary of block names and their parameter values.

Simulink
params = {blk: get_param(blk, '[1]') for blk in [2]
Drag options to blanks, or click blank then click option'
AName
BParameters
Cblocks
DblockList
Attempts:
3 left
💡 Hint
Common Mistakes
Using incorrect parameter names.
Using a variable name that does not exist.
5fill in blank
hard

Fill all three blanks to filter blocks with a specific parameter value.

Simulink
filtered = [blk for blk in [1] if get_param(blk, '[2]') == '[3]']
Drag options to blanks, or click blank then click option'
Ablocks
BBlockType
CGain
DblockList
Attempts:
3 left
💡 Hint
Common Mistakes
Using wrong parameter names or values.
Using a variable that is not a list of blocks.