MATLAB Cheat Sheet 2026
The 30 highest-yield MATLAB facts, distilled from real exam questions. Print it, save it as a PDF, or study it here — free, no sign-up.
50 questions
60 min time limit
70% to pass
- According to the Nyquist-Shannon theorem, what is the minimum sampling rate required to reconstruct a signal with maximum frequency f_max? → 2 * f_max
- What function reads a text file line by line in MATLAB? → fgetl
- What does the Workspace not display? → Time of variable generation
- What built-in MATLAB constant represents the square root of -1? → i,j
- Which MATLAB function computes the linear convolution of two discrete-time sequences u and v? → conv(u, v)
- A user executes the following code in a new MATLAB session: x = 1:5; y = x(end) + x(1); What is the value of 'y' in the Workspace? → 6
- How to clear the command window in Matlab? → Clc
- A user executes the following code: `A = [1 2; 3 4];` `B = [5; 6];` `C = A * B;` What are the dimensions of the resulting matrix `C`? → 2x1
- Which MATLAB function finds the minimum of an unconstrained multivariable function? → fminsearch
- What is the primary purpose of the MATLAB `resample(x, p, q)` function? → To change the effective sampling rate of signal x by ratio p/q
- Which MATLAB function performs the Fast Fourier Transform? → fft
- Given a vector `V = [5, 12, 3, 18, 9, 15]`, which of the following commands will return a logical vector indicating which elements of V are greater than 10? → V > 10
- Which MATLAB function estimates the power spectral density of a signal using Welch's averaged periodogram method? → pwelch(x)
- What is the use of the abs function in Matlab? → Returns magnitude of a number
- Why is `filtfilt(b, a, x)` preferred over `filter(b, a, x)` in many signal processing applications? → It achieves zero-phase distortion by filtering the signal forward and backward
- What is the return type of the function of the angle in MATLAB? → Radians
- How may the execution of a series of commands be stopped? → Press Ctrl +c
- What MATLAB command should be used to make y = 3(x+2) when x = 2? → ">> x = 2; >> y = 3*(x+2);"
- Which of the following is an invalid variable name in MATLAB? → _var
- Which MATLAB function replaces occurrences of a substring within a string? → strrep
- Which MATLAB function solves a system of linear equations Ax = b? → linsolve(A, b) or A\b
- What function imports data from a space-delimited text file into a matrix in MATLAB? → All of the above can work
- Which of the following commands is used to create a 3D line plot (a helix, for example) from vectors `x`, `y`, and `z`? → plot3(x,y,z)
- After executing the following code, what is the final value of `x`? ```matlab x = 1; n = 10; while x <= n x = x * 2; n = n - 1; end ``` → 8
- The MATLAB-generated graph windows can be closed using the _________ function. → Close all
- What is the purpose of `chol(A)` in MATLAB? → Computes the Cholesky factorization of a symmetric positive definite matrix
- What is the primary characteristic of a `persistent` variable in a MATLAB function? → Its value is retained in memory between calls to the function.
- Which MATLAB function trims leading and trailing whitespace from a string? → strtrim
- What does `fprintf(fid, '%d\n', x)` do in MATLAB? → Writes formatted integer x followed by newline to the file with identifier fid
- What will be the output of atan2(-1,1) in Matlab? → 0.7854
Turn these facts into recall: