General MCQ Flashcards
7 cards from real MATLAB practice questions. Tap to flip, then mark Knew It or Still Learning — missed cards come back until you master them.
Read the first 7 General MCQ flashcards as text
In MATLAB, what is the default data type for numeric values?
Answer: double
MATLAB stores numeric values as double-precision floating-point (double) by default unless explicitly specified otherwise.
Which function would you use to plot a function y = sin(x) over the range [0, 2π] in MATLAB?
Answer: x = 0:pi/100:2*pi; plot(x, sin(x))
You must first define a vector x with the desired range, then pass both x and sin(x) to the plot() function.
What does 'NaN' represent in MATLAB?
Answer: Not a Number — an undefined or unrepresentable value
NaN stands for Not a Number and results from undefined operations like 0/0 or Inf - Inf.
How do you suppress output in MATLAB when executing a command?
Answer: Add a semicolon (;) at the end
Appending a semicolon at the end of a statement suppresses the automatic display of its result in the Command Window.
Which MATLAB function computes the Fast Fourier Transform of a signal?
Answer: fft(x)
fft(x) computes the discrete Fourier transform of vector x using the Fast Fourier Transform algorithm.
What is the result of the MATLAB expression: [1 2 3] + [4; 5; 6]?
Answer: A 3×3 matrix via broadcasting
In MATLAB R2016b+, implicit expansion (broadcasting) allows a 1×3 row vector and a 3×1 column vector to be added, producing a 3×3 matrix.
Which MATLAB function saves workspace variables to a .mat file?
Answer: save('file.mat')
The save function writes workspace variables to a binary .mat file, which can later be loaded with the load function.