What loop structure would you use to iterate through each element of an array?
What is a for loop?
What keyword do you use to start a conditional statement in MATLAB?
What is if?
This command is used to clear all variables from the workspace in MATLAB.
What is clear?
This keyword is used to stop a loop.
What is break?
What will happen if the condition of a while loop is always true?
What is that it will create an infinite loop?
This keyword is used to define an alternative path when the condition in an if statement is false.
What is else?
The symbol used to indicate matrix transposition in MATLAB.
What is the apostrophe (')?
This command is used to create a figure window for plotting.
What is figure()?
What is the main difference between for and while loops?
What is that for loops iterate a specific number of times, while while loops continue until a condition is false?
This operator is used to compare two values for equality in an if statement.
What is ==?
To display a message or value in the Command Window, you would use this function.
What is disp()?
To label the X-axis of a plot, you would use this function.
What is xlabel()?
This function can help determine the number of iterations in a loop based on the size of an array.
What is length?
What is the purpose of the else keyword in a decision structure?
What is to provide an alternative action when the if condition is false?
This function returns the largest element in a vector.
What is max()?
This function creates a simple 2D line plot of given X and Y data.
What is plot()?
What is the output of the following code?
x = 1;
for i = 1:5
x = x + i;
end
What is 16?
This operator is used to negate a condition in an if statement.
What is ~ (tilde)?
This operator is used for element-wise multiplication in MATLAB.
What is .*?
This function creates an array of random numbers.
What is randi()?