0
0
MATLABdata~10 mins

Why 3D plots show complex relationships 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 create a 3D plot using the plot3 function.

MATLAB
x = 1:10;
y = sin(x);
z = cos(x);
plot3(x, y, [1]);
grid on;
Drag options to blanks, or click blank then click option'
Asin(x)
Bx
Cy
Dz
Attempts:
3 left
💡 Hint
Common Mistakes
Using y instead of z for the third argument.
Passing a function call instead of a variable.
2fill in blank
medium

Complete the code to label the axes of the 3D plot correctly.

MATLAB
xlabel('X-axis');
ylabel('Y-axis');
zlabel([1]);
Drag options to blanks, or click blank then click option'
A'Z-axis'
B'X-axis'
C'Y-axis'
D'Depth'
Attempts:
3 left
💡 Hint
Common Mistakes
Labeling the z-axis as 'X-axis' or 'Y-axis'.
Using an incorrect string without quotes.
3fill in blank
hard

Fix the error in the code to plot a 3D curve with proper data vectors.

MATLAB
t = linspace(0, 2*pi, 100);
x = sin(t);
y = cos(t);
z = t;
plot3(x, y, [1]);
grid on;
Drag options to blanks, or click blank then click option'
At
Bsin(t)
Cy
Dcos(t)
Attempts:
3 left
💡 Hint
Common Mistakes
Passing y or cos(t) instead of z data.
Using a function call instead of the variable.
4fill in blank
hard

Fill both blanks to create a 3D scatter plot with colored points based on z values.

MATLAB
x = randn(1, 50);
y = randn(1, 50);
z = randn(1, 50);
scatter3(x, y, [1], 36, [2], 'filled');
Drag options to blanks, or click blank then click option'
Az
Bx
Dy
Attempts:
3 left
💡 Hint
Common Mistakes
Using x or y instead of z for the third coordinate.
Setting color to a coordinate that doesn't represent depth.
5fill in blank
hard

Fill all three blanks to create a mesh grid and plot a 3D surface showing a complex relationship.

MATLAB
[X, Y] = meshgrid(-2:0.2:2, -2:0.2:2);
Z = [1](X) .* [2](Y);
surf(X, Y, Z);
title('[3]');
Drag options to blanks, or click blank then click option'
Asin
Bcos
CSine times Cosine surface
Dtan
Attempts:
3 left
💡 Hint
Common Mistakes
Using tan which can cause undefined values.
Incorrect title string or missing function calls.