0
0
MATLABdata~10 mins

Subplot for multiple panels in MATLAB - Interactive Code Practice

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

Complete the code to create a 2x2 grid of subplots.

MATLAB
subplot([1], 2, 1); plot(1:10);
Drag options to blanks, or click blank then click option'
A4
B2
C3
D1
Attempts:
3 left
💡 Hint
Common Mistakes
Using the number of rows or columns alone instead of their product.
Confusing the order of arguments in subplot.
2fill in blank
medium

Complete the code to create the third subplot in a 2x2 grid.

MATLAB
subplot(2, 2, [1]); plot(rand(5));
Drag options to blanks, or click blank then click option'
A3
B2
C1
D4
Attempts:
3 left
💡 Hint
Common Mistakes
Using 4 instead of 3 for the third subplot.
Confusing subplot numbering order.
3fill in blank
hard

Fix the error in the code to create a 3x1 subplot and plot data in the second panel.

MATLAB
subplot(3, [1], 2); plot(sin(1:10));
Drag options to blanks, or click blank then click option'
A1
B2
C4
D3
Attempts:
3 left
💡 Hint
Common Mistakes
Using 3 instead of 1 for the number of columns.
Mixing up rows and columns order.
4fill in blank
hard

Fill both blanks to create a 2x3 grid and plot in the last panel.

MATLAB
subplot([1], [2], 6); plot(rand(10));
Drag options to blanks, or click blank then click option'
A2
B3
C4
D6
Attempts:
3 left
💡 Hint
Common Mistakes
Swapping rows and columns.
Using 6 as the number of rows or columns.
5fill in blank
hard

Fill all three blanks to create a 3x2 grid and plot in the middle panel.

MATLAB
subplot([1], [2], [3]); plot(cos(1:10));
Drag options to blanks, or click blank then click option'
A3
B2
C4
Attempts:
3 left
💡 Hint
Common Mistakes
Confusing the order of rows and columns.
Using wrong panel number for the middle panel.