Complete the code to create a zero-order hold block in Simulink.
zoh_block = add_block('simulink/Discrete/Zero-Order Hold', '[1]');
The zero-order hold block is added to the model with a unique path name.
Complete the code to set the sample time of the zero-order hold block to 0.1 seconds.
set_param('[1]', 'SampleTime', '0.1');
The sample time parameter of the zero-order hold block is set to 0.1 seconds.
Fix the error in the code to connect the zero-order hold block output to a scope block input.
add_line('myModel', '[1]', 'myModel/Scope/1');
The output port of the zero-order hold block is connected to the input port of the scope block.
Fill both blanks to create a zero-order hold block and set its sample time to 0.05 seconds.
add_block('[1]', '[2]'); set_param('[2]', 'SampleTime', '0.05');
The zero-order hold block is added and its sample time is set correctly.
Fill all three blanks to add a zero-order hold block, set its sample time to 0.2, and connect it to a scope block.
add_block('[1]', '[2]'); set_param('[2]', 'SampleTime', '0.2'); add_line('myModel', '[3]', 'myModel/Scope/1');
The zero-order hold block is added, configured, and connected to the scope correctly.
