0
0
MATLABdata~10 mins

contour plots 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 contour plot of matrix Z.

MATLAB
contour([1]);
Drag options to blanks, or click blank then click option'
Amesh
Bplot
CZ
Dsurf
Attempts:
3 left
💡 Hint
Common Mistakes
Using plot instead of contour.
Using mesh or surf which create 3D plots.
2fill in blank
medium

Complete the code to generate X and Y grid matrices for contour plotting.

MATLAB
[X, Y] = meshgrid([1], [2]);
Drag options to blanks, or click blank then click option'
Acontour
BZ
CY
Dx
Attempts:
3 left
💡 Hint
Common Mistakes
Passing matrix Z instead of vector x.
Using contour or Y as input which are not vectors.
3fill in blank
hard

Fix the error in the code to plot contour lines with 10 levels.

MATLAB
contour(X, Y, Z, [1]);
Drag options to blanks, or click blank then click option'
A10
B5
C'10'
D[10]
Attempts:
3 left
💡 Hint
Common Mistakes
Using quotes around 10 making it a string.
Using brackets which create an array.
4fill in blank
hard

Fill both blanks to create a contour plot with labeled contour lines.

MATLAB
C = contour(X, Y, Z, [1]);
clabel([2]);
Drag options to blanks, or click blank then click option'
A20
BZ
CC
DX
Attempts:
3 left
💡 Hint
Common Mistakes
Using the data matrix Z instead of the contour matrix C for labeling.
Not specifying the number of contour levels.
5fill in blank
hard

Fill all three blanks to create a filled contour plot with a colorbar and title.

MATLAB
contourf(X, Y, Z, [1]);
colorbar([2]);
title([3]);
Drag options to blanks, or click blank then click option'
A15
B'eastoutside'
C'My Contour Plot'
D'north'
Attempts:
3 left
💡 Hint
Common Mistakes
Using incorrect colorbar location strings.
Not quoting the title string.