Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to plot a red dashed line.
MATLAB
plot(x, y, '[1]')
Drag options to blanks, or click blank then click option'
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.
✗ Incorrect
The code uses 'r--' to plot a red dashed line in MATLAB.
2fill in blank
mediumComplete 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'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'ro-' which is red circles instead of blue.
Using line styles like '--' which is dashed, not solid.
✗ Incorrect
'bo-' means blue circle markers connected by a solid line.
3fill in blank
hardFix 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'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'g*-' which is solid line, not dotted.
Using 'g-:' which places line style before marker, incorrect order.
✗ Incorrect
'g*:' correctly specifies green star markers with dotted lines.
4fill in blank
hardFill 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'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'o' instead of '+' for markers.
Mixing up line style symbols like '--' instead of '-.'.
✗ Incorrect
'm+' specifies magenta color and plus markers, '-.' is dash-dot line style.
5fill in blank
hardFill 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'
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.
✗ Incorrect
'k' is black color, 's:' is square marker with dotted lines, and the title is set to 'My Plot'.