0
0
MATLABdata~10 mins

Axis control and formatting 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 set the x-axis limits from 0 to 10.

MATLAB
xlim([1]);
Drag options to blanks, or click blank then click option'
A(0, 10)
B[0 10]
C{0, 10}
D0:10
Attempts:
3 left
💡 Hint
Common Mistakes
Using parentheses instead of square brackets.
Using curly braces which create a cell array.
Using a colon operator which creates a vector of multiple points.
2fill in blank
medium

Complete the code to set the y-axis scale to logarithmic.

MATLAB
set(gca, '[1]', 'log');
Drag options to blanks, or click blank then click option'
AYScale
BYLim
CYDir
DYTick
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'YLim' which sets limits, not scale.
Using 'YDir' which controls direction.
Using 'YTick' which controls tick marks.
3fill in blank
hard

Fix the error in the code to set the x-axis ticks at 0, 5, and 10.

MATLAB
set(gca, 'XTick', [1]);
Drag options to blanks, or click blank then click option'
A[0 5 10]
B(0, 5, 10)
C{0, 5, 10}
D0:5:10
Attempts:
3 left
💡 Hint
Common Mistakes
Using parentheses or curly braces which are invalid here.
Using colon operator which creates a vector but with different spacing.
4fill in blank
hard

Fill both blanks to set the x-axis label and its font size.

MATLAB
xlabel('[1]', 'FontSize', [2]);
Drag options to blanks, or click blank then click option'
ATime (s)
B12
C14
DAmplitude
Attempts:
3 left
💡 Hint
Common Mistakes
Using a number as the label text.
Using a string instead of a number for font size.
5fill in blank
hard

Fill all three blanks to create a plot, set the y-axis limits, and add a grid.

MATLAB
plot(x, y, '[1]');
ylim([2]);
grid([3]);
Drag options to blanks, or click blank then click option'
A'r--'
B[0 100]
C'on'
D'b-'
Attempts:
3 left
💡 Hint
Common Mistakes
Using incorrect line style strings.
Using parentheses instead of square brackets for limits.
Using 'off' instead of 'on' for grid.