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
- What does `fliplr([1 2 3; 4 5 6])` return? → [3 2 1; 6 5 4]
- How do you add a new field 'age' with value 30 to an existing structure variable 'person'? → person.age = 30
- 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
- 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
- What is the result of calling a function handle `f = @(x) x + 1` with `f(4)`? → 5
- What function reads a text file line by line in MATLAB? → fgetl
- After executing `x = 5; y = x; x = 10;`, what is the value of `y`? → 5
- What App Designer property determines the order in which Tab key presses move focus between components? → TabOrder
- 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
- What does the Workspace not display? → Time of variable generation
- Which of the following creates a 3×3 identity matrix in MATLAB? → eye(3)
- 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
- Which MATLAB function evaluates a string as a MATLAB expression? → eval()
- What built-in MATLAB constant represents the square root of -1? → i,j
- What does the `nargin` function return inside a MATLAB function? → Number of input arguments passed by the caller
- Which statement correctly defines a function that takes no inputs and returns no outputs in MATLAB? → function myFunc()
- Which MATLAB function displays a multi-line text input dialog and returns the string entered by the user? → inputdlg
- 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
- Which MATLAB function computes the linear convolution of two discrete-time sequences u and v? → conv(u, v)
- Which MATLAB environment panel lets you navigate the file system and open files without typing full paths? → Current Folder browser
- What is the purpose of the 'nargin' variable inside a MATLAB function? → Number of input arguments passed to the function
- Given A is a 3x4 matrix, what is the size of `A' * A`? → 4x4
- 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
- Which operator performs element-wise multiplication in MATLAB? → .*
- In App Designer, what does the startup function (startupFcn) allow you to do? → Initialize component values and app state before the UI is shown
- Which MATLAB function computes the determinant of a square matrix? → det(A)
- What is the MATLAB syntax to flip a matrix A left-to-right? → fliplr(A)
- Which MATLAB function creates a quiver (vector field) plot? → quiver
- When calling 'uiimport' in MATLAB, what is the primary use case? → Launching a graphical Import Wizard dialog for interactive file import
- In MATLAB, what does `norm(v)` compute for a vector v by default? → The L2 norm (Euclidean length)
Turn these facts into recall:
Was this helpful?