Run a terminal in MATLAB®. Use the terminal to run command-line interface tools such AI coding agents, git, and docker without leaving the MATLAB desktop.
hero.mp4
- Get Started
- Set Up AI Agents
- Use Terminal in Simulink
- Additional Terminal Commands
- Uninstall
- Licensing
- Contact Support
- You require MATLAB R2024b or later.
- Download MATLAB Terminal (GitHub) and install the toolbox in MATLAB:
matlab.addons.install('Terminal.mltbx')
- Open a terminal in MATLAB:
% Open a docked terminal t = terminal();
To use AI agents in the MATLAB terminal, you can use a wizard which sets up for you:
- an AI agent such as Claude Code, Gemini, or Amp.
- the MATLAB MCP Core Server
- skills to help your AI agent use MATLAB and Simulink, from MATLAB Agentic Toolkit (GitHub) and Simulink Agentic Toolkit (GitHub)
Run the wizard:
% Interactive wizard (first run)
t = terminal(Agentic=true);You can also programmatically specify your agent and toolkits.
t = terminal(Agent="claude");
t = terminal(Agent="gemini", Toolkits=["matlab","simulink"]);
To change your options later on, run terminal.resetAgentOptions and re-run interactive wizard.
For more information about using the AI setup process, see Using the Terminal AI Setup (GitHub).
Dock a terminal directly into the Simulink® editor as a right-side panel. This gives you command-line access alongside your model without switching windows.
% Dock terminal in the most recently active Simulink editor
t = terminal(Place="simulink");
% Target a specific model by name
t = terminal(Model="myController");
% Customize the panel title
t = terminal(Place="simulink", Name="Build");Requirements:
- Simulink must be installed and a model must be open before running the command.
- The terminal panel appears in the right dock of the Simulink editor.
You can use these additional commands with your terminal.
| Description | Command |
|---|---|
| Copy | Ctrl + Shift + C |
| Paste | Ctrl + Shift + V |
| Update terminal | terminal.update() |
| Uninstall terminal | matlab.addons.uninstall('Terminal') |
| Open with a custom title | t = terminal(Name="Build"); |
| Open in a floating window | t = terminal(WindowStyle="normal"); |
| Open with a specific shell | Linux/macOS: t = terminal(Shell="zsh");Windows: t = terminal(Shell="powershell.exe"); |
| Dock in Simulink editor | t = terminal(Place="simulink"); |
| Dock in a specific model | t = terminal(Model="myModel"); |
| Query where terminal is docked | t.Place |
| Customize terminal color theme | For instructions, see Customize Terminal Theme (GitHub) |
| List all running terminals | terminal.list() |
| Close all running terminals | terminal.closeAll() |
| Close a single terminal | delete(t); or exit |
| Query the shell in use | t.Shell |
| Check the installed version | terminal.version() |
To remove Terminal and all artifacts it created:
% 1. Uninstall the toolbox
matlab.addons.uninstall('Terminal')
% 2. Remove saved preferences
if ispref('terminal'), rmpref('terminal'); end
% 3. Remove downloaded agentic toolkits (if you used Agentic=true)
if ispc, home = getenv('USERPROFILE'); else, home = getenv('HOME'); end
rmdir(fullfile(home, '.matlab', 'agentic-toolkits'), 's')The license is available in the LICENSE.md file in this GitHub repository.
MathWorks encourages you to use this repository and provide feedback. To request technical support or submit an enhancement request, create a GitHub issue or contact MathWorks Technical Support.
Copyright 2026 The MathWorks, Inc.
