0
0
MATLABdata~10 mins

Line styles, markers, and colors 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 plot a red dashed line.

MATLAB
plot(x, y, '[1]')
Drag options to blanks, or click blank then click option'
A'b-.'
B'r--'
C'g:'
D'k-'
Attempts:
3 left
💡 Hint
Common Mistakes
Using a color without a line style, like 'r' only.
Using a line style without a color, like '--' only.
2fill in blank
medium

Complete the code to plot blue circle markers connected by a solid line.

MATLAB
plot(x, y, '[1]')
Drag options to blanks, or click blank then click option'
A'bo-'
B'g*--'
C'k:+'
D'ro-'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'ro-' which is red circles instead of blue.
Using line styles like '--' which is dashed, not solid.
3fill in blank
hard

Fix the error in the code to plot green star markers with dotted lines.

MATLAB
plot(x, y, '[1]')
Drag options to blanks, or click blank then click option'
A'g:o'
B'g*-'
C'g-:'
D'g*:'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'g*-' which is solid line, not dotted.
Using 'g-:' which places line style before marker, incorrect order.
4fill in blank
hard

Fill both blanks to plot magenta plus markers with dash-dot lines.

MATLAB
plot(x, y, '[1][2]')
Drag options to blanks, or click blank then click option'
A'm+'
B'+-'
C'-.'
D'o'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'o' instead of '+' for markers.
Mixing up line style symbols like '--' instead of '-.'.
5fill in blank
hard

Fill all three blanks to plot black square markers with dotted lines and label the plot.

MATLAB
plot(x, y, '[1][2]');
title('[3]');
Drag options to blanks, or click blank then click option'
A'k'
B's:'
C'.'
D'My Plot'
Attempts:
3 left
💡 Hint
Common Mistakes
Using '.' which is point marker instead of 's:' for square markers with dotted lines.
Forgetting to put the title string in quotes.