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
  1. 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
  2. What function reads a text file line by line in MATLAB? fgetl
  3. What does the Workspace not display? Time of variable generation
  4. What built-in MATLAB constant represents the square root of -1? i,j
  5. Which MATLAB function computes the linear convolution of two discrete-time sequences u and v? conv(u, v)
  6. 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
  7. How to clear the command window in Matlab? Clc
  8. 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
  9. Which MATLAB function finds the minimum of an unconstrained multivariable function? fminsearch
  10. 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
  11. Which MATLAB function performs the Fast Fourier Transform? fft
  12. 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
  13. Which MATLAB function estimates the power spectral density of a signal using Welch's averaged periodogram method? pwelch(x)
  14. What is the use of the abs function in Matlab? Returns magnitude of a number
  15. 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
  16. What is the return type of the function of the angle in MATLAB? Radians
  17. How may the execution of a series of commands be stopped? Press Ctrl +c
  18. What MATLAB command should be used to make y = 3(x+2) when x = 2? ">> x = 2; >> y = 3*(x+2);"
  19. Which of the following is an invalid variable name in MATLAB? _var
  20. Which MATLAB function replaces occurrences of a substring within a string? strrep
  21. Which MATLAB function solves a system of linear equations Ax = b? linsolve(A, b) or A\b
  22. What function imports data from a space-delimited text file into a matrix in MATLAB? All of the above can work
  23. 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)
  24. 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
  25. The MATLAB-generated graph windows can be closed using the _________ function. Close all
  26. What is the purpose of `chol(A)` in MATLAB? Computes the Cholesky factorization of a symmetric positive definite matrix
  27. What is the primary characteristic of a `persistent` variable in a MATLAB function? Its value is retained in memory between calls to the function.
  28. Which MATLAB function trims leading and trailing whitespace from a string? strtrim
  29. What does `fprintf(fid, '%d\n', x)` do in MATLAB? Writes formatted integer x followed by newline to the file with identifier fid
  30. What will be the output of atan2(-1,1) in Matlab? 0.7854
Turn these facts into recall: