Basic Introduction 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 Basic Introduction flashcards as text
Which MATLAB function is used to find the maximum value in a vector?
Answer: max(v)
max(v) returns the largest element in vector v, and can also return its index as a second output.
What does the command 'format long' change in MATLAB?
Answer: Displays more decimal digits in numeric output
format long switches display to 15 significant digits instead of MATLAB's default 4-digit short format.
How do you transpose a matrix A in MATLAB?
Answer: Both transpose(A) and A'
Both A' (conjugate transpose) and transpose(A) transpose the matrix; for real matrices they produce the same result.
What is the output of mod(10, 3) in MATLAB?
Answer: 1
mod(10,3) returns 1 because 10 = 3×3 + 1, so the remainder is 1.
Which file extension is used for MATLAB script files?
Answer: .m
MATLAB script and function files use the .m extension, while .mat files store workspace data.
What happens when you type a variable name in the Command Window without a semicolon?
Answer: MATLAB prints the variable's value
Without a semicolon, MATLAB echoes the variable's name and current value to the Command Window.
Which MATLAB function generates a vector of n evenly spaced points between a and b?
Answer: linspace(a, b, n)
linspace(a, b, n) creates a row vector of n linearly spaced values from a to b inclusive.