MATLAB Cheat Sheet
|
This content was generated with the assistance of AI and should be verified against the official documentation before being relied on in production. The reference material consulted while preparing these pages is listed in the section bibliography. |
A single-page, colour-coded summary of MATLAB, written against MATLAB R2026b (announced 2026-09-28) and checked on 2026-10-22, when the release notes listed no newer release — the environment commands (help, doc, which -all, whos, clear, format, save and load, addpath, startup.m and matlab -batch), syntax (comments, continuation, sections, command and function syntax), arrays and a column-major diagram, an indexing grid for (), {} and . across arrays, cells, structures and tables, operators with the precedence ladder and the implicit-expansion rules, the table of types (double to uint64, logical, char, string, cell, struct, table, timetable, datetime, categorical, dictionary), text and regular expressions, control flow, functions (local, nested and anonymous, arguments blocks with validators and Name=Value), errors and onCleanup, classdef (value and handle classes, events, enumerations, namespaces), graphics, data input and output, the core mathematics (linear algebra, sparse, polynomials, integral, ode45, fft), performance, testing and buildtool, Python, C and Java interfaces, live scripts, App Designer, projects and the package manager, and a strip of what changed from older tutorials to R2026b — handy for quick memorization or as a downloadable PDF desk reference.
For the full explanation, every option, and additional examples, see the dedicated pages:
Start here — MATLAB Reference.
Getting started — Getting Started, Design Philosophy and Coming from Other Languages, Desktop and Command Window, Getting Help and Documentation, Workspace Variables and MAT-Files and Search Path, Startup and Files.
Language fundamentals — Syntax, Statements and Variables, Matrices and Arrays, Indexing, Operators and Precedence, Logical Type and Conditions, Implicit Expansion and Compatible Sizes and Comma-Separated Lists.
Data types — Numeric Types and Floating Point, Strings and Character Arrays, Regular Expressions and Patterns, Cell Arrays, Structures, Tables, Timetables, Dates and Times, Categorical Arrays, Dictionaries and containers.Map, Missing Data, Type Identification and Conversion and Sets and Sorting.
Control flow — Control Flow.
Scripts and functions — Scripts and Code Sections, Functions, Local, Nested and Private Functions, Anonymous Functions and Function Handles, Argument Validation, Variable Number of Arguments, Workspaces, Scope, Global and Persistent Variables, Function Precedence and Name Resolution and eval and Its Alternatives.
Errors, debugging and code quality — Errors, Warnings and Exceptions, Debugging, Code Analyzer and Code Quality, Help Text and Documenting Code and Secrets and Protecting Code.
Object-oriented programming — Classes with classdef: the Basics, Value and Handle Classes, Properties and Methods, Inheritance and Abstract Classes, Events and Listeners, Enumerations, Namespaces and Class Folders and Object Arrays, Customization and Introspection.
Graphics — 2-D Plotting, 3-D Plotting and Surfaces, Graphics Objects and Customization and Exporting Figures and Images.
Data import and export — Reading and Writing Tabular Data, Low-Level File I/O and the File System, JSON, XML and Web Access and Large Data, Datastores and Tall Arrays.
Mathematics — Linear Algebra, Sparse Matrices and Graphs, Elementary Math, Polynomials and Interpolation, Random Numbers and Reproducibility, Descriptive Statistics and Preprocessing, Integration, ODEs and Optimization and Fourier Analysis and Filtering.
Performance — Vectorization and Preallocation, Profiling and Timing and Background and Asynchronous Execution.
Testing and build — Unit Testing with matlab.unittest, Test Fixtures, Parameterization and Mocking, Build Automation with buildtool and Continuous Integration.
Interfaces with other languages — Calling Python from MATLAB, MATLAB Engine API for Python, C and C++ Libraries and MEX and Java, .NET and System Commands.
Live scripts, apps and sharing — Live Scripts and the Live Editor, Building Apps with App Designer, Projects and Source Control and Packages and the MATLAB Package Manager.
Practice and reference — Coding Style and Idioms, What’s New and Migrating Older Code, GNU Octave Compatibility and Toolboxes and Add-On Products.
References
The PDF summarizes the official documentation; each source is cited in full on the page listed above that covers it, and in the section bibliography.