Getting Started with MATLAB
Learn the MATLAB environment and begin writing code with hands-on examples
Whether you are new to MATLAB or returning after time away, you can get oriented quickly with core concepts and hands-on examples. Start by exploring the desktop and running short snippets in the Command Window. Then, build a workflow to reuse for your own projects.
Create prototypes in MATLAB that turn raw data into clear insights. Organize steps for data import, cleaning, analysis, and visualization into reusable and shareable workflows. This approach helps you focus on results rather than managing code.
% Arrays: time and measured signals
time = (0:0.01:0.04)'; % seconds
voltage = [3.3 3.4 3.6 3.5 3.7]';
current = [0.10 0.11 0.13 0.12 0.14]';
% Create a table of measurements
measurements = table(time,voltage,current)
% Array indexing
voltage(3) % third voltage sample
voltage(voltage > 3.5) % voltages above threshold
% Table indexing
measurements(2:4, :) % time window
measurements.voltage(3) % named variable access
measurements{3, "current"} % numeric value fromtable
Data smoothing: Reduce noise in signals using moving averages, medians, or the Savitzky-Golay method.
Outlier detection: Identify and replace or remove data points that deviate significantly from expected patterns.
If you know exactly how you want to visualize your data, select/highlight it in the workspace and MATLAB will display all relevant chart types for your data.
Call functions or objects in Python® directly from MATLAB. This enables you to work in MATLAB without switching your programming environment.
% Configure Python (one-time setup)
pyenv("Version","/usr/bin/python3")
% Call Python from MATLAB
py.print("Hello from Python")
% Use NumPy from MATLAB
np = py.importlib.import_module("numpy");
x = np.arange(5);
y = double(x); % convert to MATLAB array
meanValue = mean(y)
Share MATLAB projects on GitHub®. Create a repository, upload code, write a README file, and add a one-click Open in MATLAB Online badge for instant collaboration.
Tip: Use MATLAB with Jupyter® Notebooks, VisualStudio® Code, and AI coding tools like Claude®.
Free, self‑paced tutorials help you learn the basics and build new skills at your own pace. Topics include MATLAB fundamentals, app building, and object‑oriented programming, so you can progress from introductory concepts to more advanced workflows as needed.