Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to create a transfer function block in Simulink.
Simulink
sys = tf([1], [1 3 2]);
Attempts:
3 left
💡 Hint
Common Mistakes
Using denominator coefficients instead of numerator.
Mixing up the order of coefficients.
✗ Incorrect
The transfer function numerator is set to [1] to define the system.
2fill in blank
mediumComplete the code to plot the step response of the system.
Simulink
step([1]);Attempts:
3 left
💡 Hint
Common Mistakes
Using undefined variables like 'sys_response'.
Passing strings instead of system objects.
✗ Incorrect
The step function requires the system variable 'sys' to plot its response.
3fill in blank
hardFix the error in the code to compute the poles of the system.
Simulink
poles = [1](sys);Attempts:
3 left
💡 Hint
Common Mistakes
Using 'roots' which works on polynomials but not transfer functions.
Using 'eig' which is for matrices, not transfer functions.
✗ Incorrect
The correct function to find poles of a transfer function in MATLAB is 'pole'.
4fill in blank
hardFill both blanks to create a Bode plot and set the frequency range.
Simulink
bode(sys, [1]); xlim([2]);
Attempts:
3 left
💡 Hint
Common Mistakes
Using mismatched frequency ranges causing inconsistent plots.
Choosing frequency ranges too narrow or too wide.
✗ Incorrect
The frequency range [0.1 100] is used both to specify Bode plot limits and x-axis limits.
5fill in blank
hardFill all three blanks to compute the gain margin, phase margin, and crossover frequencies.
Simulink
[GM, PM, [1], [2]] = margin([3]);
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing up the order of output variables.
Using undefined system variables.
✗ Incorrect
The margin function returns gain margin (GM), phase margin (PM), gain crossover frequency (Wcg), and phase crossover frequency (Wcp) for the system 'sys'.
