Complete the code to create a Constant block with value 5.
constant_block = Simulink.BlockDiagram.createBlock('simulink/Sources/Constant', 'Value', [1])
The Constant block outputs a fixed value. Here, the value should be 5.
Complete the code to create a Step block with step time at 2 seconds.
step_block = Simulink.BlockDiagram.createBlock('simulink/Sources/Step', 'StepTime', [1])
The Step block changes its output at the specified step time. Here, it should step at 2 seconds.
Fix the error in the code to create a Sine Wave block with amplitude 3.
sine_block = Simulink.BlockDiagram.createBlock('simulink/Sources/Sine Wave', 'Amplitude', [1])
The Sine Wave block outputs a sine wave with the specified amplitude. Here, it should be 3.
Fill both blanks to create a Ramp block with slope 4 and initial output 1.
ramp_block = Simulink.BlockDiagram.createBlock('simulink/Sources/Ramp', 'Slope', [1], 'InitialOutput', [2])
The Ramp block outputs a signal that increases linearly. Slope controls the rate, InitialOutput is the start value.
Fill all three blanks to create a Step block with step time 3, initial value 0, and final value 10.
step_block = Simulink.BlockDiagram.createBlock('simulink/Sources/Step', 'StepTime', [1], 'InitialValue', [2], 'FinalValue', [3])
The Step block changes output from InitialValue to FinalValue at StepTime. Here, step time is 3, initial value 0, final value 10.
