0
0
MATLABdata~10 mins

Help system and documentation 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 display help for the function plot.

MATLAB
help [1]
Drag options to blanks, or click blank then click option'
Aaxis
Bfigure
Cplot
Dtitle
Attempts:
3 left
💡 Hint
Common Mistakes
Using a command that is not a function name after help.
Forgetting to type the function name after help.
2fill in blank
medium

Complete the code to open the documentation page for the sum function.

MATLAB
doc [1]
Drag options to blanks, or click blank then click option'
Asum
Bmean
Cmax
Dmin
Attempts:
3 left
💡 Hint
Common Mistakes
Typing a function name different from the one intended.
Using help instead of doc when the graphical documentation is needed.
3fill in blank
hard

Fix the error in the code to display help for the mean function.

MATLAB
help [1]
Drag options to blanks, or click blank then click option'
AMean
BmeAn
CMEAN
Dmean
Attempts:
3 left
💡 Hint
Common Mistakes
Using uppercase or mixed case letters in the function name.
Forgetting that MATLAB is case-sensitive for help commands.
4fill in blank
hard

Fill both blanks to create a custom help comment block for a function named myFunc with a description line.

MATLAB
% [1] - [2]
function output = myFunc(input)
% Your code here
end
Drag options to blanks, or click blank then click option'
AmyFunc
BCalculates the sum
CComputes the average
Dinput
Attempts:
3 left
💡 Hint
Common Mistakes
Putting the description before the function name.
Using variable names instead of the function name in the comment.
5fill in blank
hard

Fill all three blanks to write a help comment block with function name calcArea, description Calculates area of a circle, and input description radius of the circle.

MATLAB
% [1] - [2]
% Input:
%   [3]
function area = calcArea(r)
area = pi * r^2;
end
Drag options to blanks, or click blank then click option'
AcalcArea
BCalculates area of a circle
Cradius of the circle
Dcircle radius
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing up the order of function name and description.
Using incorrect input variable names in the comment.