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. What does `fliplr([1 2 3; 4 5 6])` return? → [3 2 1; 6 5 4]
  2. How do you add a new field 'age' with value 30 to an existing structure variable 'person'? → person.age = 30
  3. 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
  4. When using 'surf(X,Y,Z)' in MATLAB, what must be true about X, Y, and Z? → X and Y must be 2D grids (from meshgrid) and Z must be a 2D matrix of the same size
  5. What is the result of calling a function handle `f = @(x) x + 1` with `f(4)`? → 5
  6. What function reads a text file line by line in MATLAB? → fgetl
  7. After executing `x = 5; y = x; x = 10;`, what is the value of `y`? → 5
  8. What App Designer property determines the order in which Tab key presses move focus between components? → TabOrder
  9. What does the 'shading interp' command do to a surface plot in MATLAB? → Removes the mesh lines and applies smooth color interpolation across each face
  10. What does the Workspace not display? → Time of variable generation
  11. Which of the following creates a 3×3 identity matrix in MATLAB? → eye(3)
  12. What does placing a `%` at the beginning of a line in a MATLAB script or function do? → Makes that line a comment that MATLAB ignores during execution
  13. Which MATLAB function evaluates a string as a MATLAB expression? → eval()
  14. What built-in MATLAB constant represents the square root of -1? → i,j
  15. What does the `nargin` function return inside a MATLAB function? → Number of input arguments passed by the caller
  16. Which statement correctly defines a function that takes no inputs and returns no outputs in MATLAB? → function myFunc()
  17. Which MATLAB function displays a multi-line text input dialog and returns the string entered by the user? → inputdlg
  18. What is the primary difference between 'plot' and 'scatter' in MATLAB? → scatter allows per-point color and size control while plot uses uniform line style
  19. Which MATLAB function computes the linear convolution of two discrete-time sequences u and v? → conv(u, v)
  20. Which MATLAB environment panel lets you navigate the file system and open files without typing full paths? → Current Folder browser
  21. What is the purpose of the 'nargin' variable inside a MATLAB function? → Number of input arguments passed to the function
  22. Given A is a 3x4 matrix, what is the size of `A' * A`? → 4x4
  23. 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
  24. Which operator performs element-wise multiplication in MATLAB? → .*
  25. In App Designer, what does the startup function (startupFcn) allow you to do? → Initialize component values and app state before the UI is shown
  26. Which MATLAB function computes the determinant of a square matrix? → det(A)
  27. What is the MATLAB syntax to flip a matrix A left-to-right? → fliplr(A)
  28. Which MATLAB function creates a quiver (vector field) plot? → quiver
  29. When calling 'uiimport' in MATLAB, what is the primary use case? → Launching a graphical Import Wizard dialog for interactive file import
  30. In MATLAB, what does `norm(v)` compute for a vector v by default? → The L2 norm (Euclidean length)
Was this helpful?