0
0
MATLABdata~10 mins

Why visualization reveals patterns in MATLAB - Test Your Understanding

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

Complete the code to plot the data points.

MATLAB
x = 1:10;
y = [2, 4, 6, 8, 10, 12, 14, 16, 18, 20];
[1](x, y);
title('Simple Line Plot');
Drag options to blanks, or click blank then click option'
Abar
Bscatter
Cplot
Dhistogram
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'scatter' instead of 'plot' will show points but no connecting lines.
2fill in blank
medium

Complete the code to add grid lines to the plot for better pattern visibility.

MATLAB
x = 1:5;
y = [5, 3, 6, 2, 7];
plot(x, y);
[1] on;
Drag options to blanks, or click blank then click option'
Agrid
Baxis
Chold
Dlegend
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'hold on' does not add grid lines; it allows multiple plots on the same figure.
3fill in blank
hard

Fix the error in the code to correctly display a bar chart.

MATLAB
values = [3, 7, 5, 9];
[1](values);
title('Bar Chart');
Drag options to blanks, or click blank then click option'
Aplot
Bhist
Cscatter
Dbar
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'plot' or 'scatter' instead of 'bar' results in wrong chart types.
4fill in blank
hard

Fill both blanks to create a scatter plot with red circle markers.

MATLAB
x = 1:6;
y = [2, 5, 3, 7, 4, 6];
scatter(x, y, [1], '[2]');
Drag options to blanks, or click blank then click option'
A100
B'o'
C'r'
D10
Attempts:
3 left
💡 Hint
Common Mistakes
Confusing marker shape ('o') with color ('r').
5fill in blank
hard

Fill all three blanks to create a histogram with 15 bins and blue face color.

MATLAB
data = randn(100,1);
histogram(data, [1], 'FaceColor', [2], 'EdgeColor', [3]);
Drag options to blanks, or click blank then click option'
A10
B15
C'b'
D'k'
Attempts:
3 left
💡 Hint
Common Mistakes
Using wrong number of bins or mixing up face and edge colors.