Complete the code to create a new subsystem in Simulink.
new_system('[1]');
The new_system function creates a new Simulink model or subsystem with the given name.
Complete the code to add a Gain block to the subsystem.
add_block('simulink/Math Operations/Gain', '[1]/Gain1');
The block is added inside the subsystem named MySubsystem.
Fix the error in the code to connect two blocks inside the subsystem.
add_line('[1]', 'Gain1/1', 'Sum/1');
The add_line function requires the subsystem name as the first argument to connect blocks inside it.
Fill both blanks to set the Gain block's parameter and open the subsystem.
set_param('[1]/Gain1', 'Gain', '[2]'); open_system('[1]');
The Gain block inside MySubsystem is set to a gain value of 10, then the subsystem is opened.
Fill all three blanks to create a subsystem, add a Sum block, and connect it to the Gain block.
new_system('[1]'); add_block('simulink/Math Operations/Sum', '[1]/[2]'); add_line('[1]', '[2]/1', '[3]/1');
A new subsystem named ControlSubsystem is created. A Sum block named Sum1 is added inside it, then connected to the Gain block Gain1.
