Skip to content

Abhaya264/matlab-terminal

Repository files navigation

Terminal in MATLAB

Open in MATLAB Online   Download Latest

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

Table of Contents

Get Started

  • 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();

Set Up AI Agents

To use AI agents in the MATLAB terminal, you can use a wizard which sets up for you:

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).

Use Terminal in Simulink

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.

Terminal docked in the Simulink editor

% 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.

Additional Terminal Commands

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()

Uninstall

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')

Licensing

The license is available in the LICENSE.md file in this GitHub repository.

Contact Support

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.


About

No description, website, or topics provided.

Resources

License

Contributing

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors