MATLAB - MATLAB Technical Computing Practice Test

โ–ถ

MATLAB Practice Test PDF 2026

MATLAB (Matrix Laboratory) is the dominant numerical computing platform in engineering, scientific research, and data analysis. MathWorks โ€” the company behind MATLAB โ€” offers official certification exams that validate proficiency across fundamentals, data processing, and machine learning. A MATLAB practice test PDF gives you a printable, portable study resource you can annotate, time yourself against, and use anywhere without needing a computer or internet connection.

Who uses MATLAB and needs to demonstrate proficiency?

Why does PDF practice help? Working through questions on paper forces active recall โ€” you can't hover over a hint or immediately Google the syntax. You identify exactly which functions, commands, and concepts you truly know versus which ones you only recognize when you see them. Research on retrieval practice consistently shows that answering questions from memory produces stronger long-term retention than re-reading notes or watching tutorials. Print the PDF, set a timer, work through it independently, then review every wrong answer and trace it back to the specific concept you need to reinforce.

MATLAB at a Glance

MATLAB Mastery: Deep-Dive Study Guide

MATLAB Fundamentals: Variables, Arrays, and Matrices

MATLAB's core data structure is the matrix โ€” even scalars are 1ร—1 matrices and vectors are 1ร—N or Nร—1 matrices. This design philosophy means most operations are naturally vectorized, and understanding it is essential for writing efficient MATLAB code.

Creating arrays and matrices: Square brackets define arrays. a = [1 2 3] creates a 1ร—3 row vector; b = [1; 2; 3] creates a 3ร—1 column vector. Semicolons separate rows inside brackets. A = [1 2 3; 4 5 6; 7 8 9] creates a 3ร—3 matrix. Built-in creation functions: zeros(m,n), ones(m,n), eye(n) (identity matrix), rand(m,n) (uniform random), randn(m,n) (normal random), linspace(start,end,n), and the colon operator start:step:end.

Indexing: MATLAB uses 1-based indexing โ€” the first element is at index 1, not 0. For a matrix A, A(2,3) accesses row 2, column 3. The colon operator selects entire rows or columns: A(1,:) selects all of row 1; A(:,2) selects all of column 2. Logical indexing is powerful: A(A > 5) returns all elements greater than 5 as a vector. The end keyword refers to the last index: A(end,end) accesses the bottom-right element.

Operators: Standard arithmetic operators (+, -, *, /) operate on matrices according to matrix algebra rules. Element-wise operators use a dot prefix: .*, ./, .^. This distinction is critical โ€” A * B is matrix multiplication (requires compatible dimensions), while A .* B multiplies corresponding elements (requires identical dimensions). Transpose: A' for conjugate transpose; A.' for simple transpose.

Control Flow

For loops: for i = 1:10 iterates i from 1 to 10. You can iterate over column vectors: for x = [2 4 6 8] assigns x to each value in sequence. For loops over matrices iterate column by column โ€” for col = A assigns each column of A to col as a column vector.

While loops: while condition executes the body as long as condition is true. Use break to exit early, continue to skip to the next iteration. Infinite loop guard: always include a counter or convergence condition to prevent hangs.

If/elseif/else: Standard conditional flow. Logical operators: && and || for scalar short-circuit logic; & and | for element-wise array logic. ~ is the NOT operator. Comparison operators: ==, ~=, <, >, <=, >=.

Switch/case: Cleaner than long if/elseif chains when comparing a single variable against multiple discrete values. The otherwise clause handles unmatched cases. Unlike C, MATLAB switch does not fall through โ€” only the matched case executes.

Functions and Scripts

Scripts are m-files that execute a sequence of MATLAB commands in the base workspace. Variables created in a script persist in the workspace after execution. Scripts cannot accept input arguments or return output values.

Functions have their own workspace isolated from the base workspace. Syntax: function [out1, out2] = myFunc(in1, in2). Functions can return multiple outputs using square brackets. nargin returns the number of input arguments provided; nargout returns the number of requested outputs โ€” both are used for optional argument handling.

Anonymous functions create compact single-expression functions inline: f = @(x) x.^2 + 2*x + 1. They capture variables from the enclosing workspace at creation time. Function handles (@) allow passing functions as arguments to other functions โ€” essential for fminsearch, fsolve, integral, and ode45.

Subfunctions and local functions defined in the same file are accessible only within that file. Nested functions (defined inside another function) share the parent function's workspace โ€” useful but use them carefully to avoid scoping confusion.

Plotting and Visualization

MATLAB's plotting functions create publication-quality graphics. plot(x,y) creates a 2D line plot. Line properties: color ('r', 'blue', [0.5 0.2 0.8] RGB), marker ('o', 's', '^'), linestyle ('-', '--', ':'). xlabel, ylabel, title, legend, and grid on annotate the figure.

Multiple plots: hold on allows adding subsequent plots to the same axes without clearing. subplot(m,n,p) creates a grid of mร—n axes and activates the p-th panel. For 3D: plot3 for 3D lines, surf and mesh for surfaces, contour for level curves. figure creates a new figure window; clf clears the current figure. Export: saveas(gcf,'filename.png') or print('-dpng','-r300','filename') for 300 DPI output.

Numerical Methods

Linear algebra: inv(A) computes matrix inverse (avoid for large systems โ€” use backslash instead). A solves Ax=b using the most numerically stable method automatically (LU decomposition for square, least-squares for rectangular). det(A) computes determinant; rank(A) returns rank; eig(A) returns eigenvalues and eigenvectors; svd(A) performs singular value decomposition.

ODE solvers: ode45 is the workhorse solver โ€” Runge-Kutta 4th/5th order, adaptive step size, for non-stiff systems. Usage: [t,y] = ode45(@odefun, tspan, y0) where odefun takes (t,y) and returns dy/dt as a column vector. For stiff systems (common in chemical kinetics and electrical circuits), use ode15s or ode23s.

Optimization: fminsearch minimizes a scalar function using the Nelder-Mead simplex method (derivative-free). fminunc and fmincon from the Optimization Toolbox handle unconstrained and constrained optimization with gradient-based methods. lsqcurvefit fits a nonlinear model to data using least squares.

Signal Processing

The Signal Processing Toolbox extends MATLAB for frequency-domain analysis. fft(x) computes the Fast Fourier Transform of a signal vector. To interpret the output: frequency resolution is Fs/N (sampling rate divided by number of points); the first N/2+1 points represent 0 to Nyquist frequency. ifft is the inverse transform.

Digital filter design: butter designs Butterworth filters (maximally flat passband); fir1 designs FIR filters using the window method. filter(b,a,x) applies an IIR or FIR filter to signal x. freqz(b,a) plots the frequency response. Power spectral density: pwelch for Welch's method, robust against noise.

Data Import/Export and Debugging

Data import: readtable('file.csv') reads CSV files into a MATLAB table (preferred for mixed data types). xlsread/readmatrix for numeric spreadsheet data. load('file.mat') loads MATLAB workspace files. fopen/fread/fclose for low-level binary file I/O.

Data export: writetable(T,'output.csv'), writematrix(A,'output.csv'), save('workspace.mat'), xlswrite for Excel. For formatted text: fprintf with C-style format strings.

Debugging: The MATLAB Editor includes a visual debugger. Set breakpoints by clicking the line margin. Step commands: F10 (step over), F11 (step into), F12 (step out). keyboard command inside a function drops execution to the command prompt in the function's workspace โ€” inspect and modify variables interactively, then dbcont to continue. try/catch blocks handle runtime errors gracefully. error('message') and warning('message') generate explicit errors and warnings.

MathWorks MATLAB Certifications

MathWorks offers official certifications through an online proctored exam format. Three current tracks:

MATLAB Fundamentals: Tests core language features โ€” variable types, array/matrix operations, control flow, functions, file I/O, basic plotting, and code vectorization. This is the entry-level certification appropriate for students and early-career engineers.

MATLAB for Data Processing and Visualization: Covers data import/export, data cleaning, table operations, categorical variables, statistical summaries, and advanced visualization techniques. Targets analysts who use MATLAB as a data transformation and reporting tool.

Machine Learning with MATLAB: Tests the Statistics and Machine Learning Toolbox โ€” supervised learning (classification and regression trees, SVMs, ensemble methods), unsupervised learning (k-means, hierarchical clustering), feature selection, cross-validation, hyperparameter tuning, and basic deep learning with the Deep Learning Toolbox. This is the advanced certification for data scientists and AI researchers using MATLAB.

Certification preparation: MathWorks provides official training courses (MATLAB Fundamentals, MATLAB Programming Techniques, Machine Learning with MATLAB) that align directly with exam content. Completing the official course and working through all exercises is the recommended preparation path. Supplement with PDF practice tests to identify gaps before sitting the proctored exam.

Download and print the practice test PDF โ€” attempt timed without reference materials first
Master the difference between matrix operators (*, /) and element-wise operators (.*, ./)
Practice 1-based indexing, colon operator, logical indexing, and the end keyword
Know all loop types (for, while) and flow controls (break, continue, return)
Understand function workspace isolation vs. script base workspace
Review anonymous functions and function handles for passing functions as arguments
Study ode45 syntax and when to use stiff solvers (ode15s) instead
Practise fft output interpretation: frequency resolution, Nyquist limit, two-sided vs. one-sided spectrum
Know readtable, writetable, load/save, and fprintf for data import/export
Review all three MathWorks certification tracks and their distinct content blueprints

Advance Your MATLAB Skills with Practice Tests

Technical certifications and university assessments both reward candidates who can answer under time pressure without reference materials. Regular practice with timed tests โ€” PDF and interactive โ€” builds that fluency. Use the PDF for initial exposure and timed drilling; use online quizzes for targeted topic review.

Explore our full library of MATLAB practice tests to keep building your proficiency across every topic area covered by the MathWorks certification exams.

What is the difference between matrix multiplication and element-wise multiplication in MATLAB?

In MATLAB, the * operator performs true matrix multiplication following linear algebra rules โ€” the inner dimensions must match (an mร—n matrix times an nร—p matrix yields an mร—p result). The .* operator performs element-wise multiplication, multiplying corresponding elements of two arrays that must have identical dimensions. This distinction applies to division (./ vs /), exponentiation (.^ vs ^), and other operators. Forgetting the dot for element-wise operations is one of the most common MATLAB errors โ€” the code runs without an error only if the dimensions happen to be compatible for matrix operations, silently producing a wrong result.

How does MATLAB indexing differ from Python or C?

MATLAB uses 1-based indexing โ€” the first element of a vector or array is at index 1, not 0 as in Python, C, Java, and most other languages. The last element can be referenced with the special keyword end. MATLAB also uses parentheses for both indexing (A(2,3)) and function calls (sin(x)), unlike Python/C which use square brackets for indexing. Multi-dimensional indexing is row, column order: A(row, col). The colon operator A(:,2) selects entire dimensions, and logical indexing A(A>5) returns elements meeting a condition โ€” both are powerful patterns with no direct equivalent in lower-level languages.

What is the difference between a MATLAB script and a function?

A script is an m-file containing a sequence of MATLAB commands that execute in the base workspace โ€” variables it creates persist in the workspace after the script finishes. Scripts cannot accept input arguments or return output values. A function is an m-file (or section of an m-file) that has its own isolated workspace โ€” variables inside a function are not accessible from the base workspace and are cleared when the function returns. Functions can accept input arguments and return multiple output values. For reusable, modular code that takes inputs and produces outputs, always use functions; use scripts for top-level workflows and exploratory analysis.

When should you use ode45 vs. ode15s in MATLAB?

Use ode45 (Runge-Kutta 4th/5th order, non-stiff) for most ODE problems โ€” it is the standard solver and works well whenever the solution varies smoothly and the system does not have components operating on vastly different timescales. Use ode15s (or ode23s) for stiff systems, where stiffness means that the ODE has eigenvalues with very different magnitudes โ€” common in chemical reaction kinetics, electrical circuits with fast and slow dynamics, and structural problems. A practical indicator: if ode45 takes an extremely long time or requires very small step sizes to converge, the system is likely stiff and you should switch to ode15s.

What are the MathWorks MATLAB certifications?

MathWorks currently offers three official MATLAB certification tracks. MATLAB Fundamentals tests core language skills: variables, arrays, matrices, control flow, functions, file I/O, and basic plotting. MATLAB for Data Processing and Visualization covers data import/export, table operations, statistical summaries, and advanced visualization. Machine Learning with MATLAB tests the Statistics and Machine Learning Toolbox โ€” supervised and unsupervised methods, cross-validation, feature selection, and basic deep learning. All exams are online proctored. MathWorks recommends completing their official training courses as primary preparation, supplemented by practice tests to identify gaps.

What is Simulink and how does it relate to MATLAB?

Simulink is a MathWorks add-on that provides a graphical block diagram environment for modeling, simulating, and analyzing dynamic systems โ€” particularly control systems, signal processing pipelines, and physical systems. It integrates tightly with MATLAB: you can call MATLAB functions from Simulink blocks, pass data between the two environments, and use MATLAB scripts to configure and run Simulink simulations programmatically. Simulink is used extensively in aerospace, automotive, and power electronics industries, and is the primary tool for Model-Based Design (MBD) and code generation for embedded systems via Embedded Coder and Simulink Coder. Many engineering employers require Simulink proficiency alongside MATLAB.
โ–ถ Start Quiz