Recall & Review
beginner
What does the
plot3 function do in MATLAB?The
plot3 function draws lines or points in 3D space using x, y, and z coordinates.Click to reveal answer
beginner
How do you call
plot3 to plot a line through points (1,2,3), (4,5,6), and (7,8,9)?Use
plot3([1 4 7], [2 5 8], [3 6 9]) to connect the points with a 3D line.Click to reveal answer
beginner
What is the role of the third input vector in
plot3(x, y, z)?The third vector
z specifies the height or depth coordinate for each point in 3D space.Click to reveal answer
intermediate
How can you change the color and style of the 3D line in
plot3?Add a format string like
'r--' to plot3, e.g., plot3(x, y, z, 'r--') for a red dashed line.Click to reveal answer
beginner
What MATLAB command helps you add labels to the axes in a 3D plot?
Use
xlabel, ylabel, and zlabel to add labels to the x, y, and z axes respectively.Click to reveal answer
Which of these commands plots a 3D line through points (1,2,3), (2,3,4), and (3,4,5)?
✗ Incorrect
plot3 requires three vectors for x, y, and z coordinates. Option A correctly provides all three.
What does the command
plot3(x, y, z, 'g:') do?✗ Incorrect
The format string 'g:' means green color with dotted line style in 3D plot.
Which function adds a label to the z-axis in a 3D plot?
✗ Incorrect
zlabel adds a label to the z-axis in MATLAB plots.
If vectors x, y, and z have different lengths, what happens when you call
plot3(x, y, z)?✗ Incorrect
All input vectors must have the same length; otherwise, MATLAB throws an error.
What is the default line color when you use
plot3 without specifying a color?✗ Incorrect
MATLAB's default line color for plots is blue.
Explain how to use
plot3 to draw a 3D line connecting points in space.Think about how you provide points in 3D and how to customize the line.
You got /4 concepts.
Describe how to add labels to each axis in a 3D plot created with
plot3.Remember the functions that name each axis.
You got /4 concepts.