MATLAB and Claude

Connect Claude to MATLAB

Use Claude Code with MATLAB® through MATLAB Agentic Toolkit, which gives Claude tools and skills for working effectively with MATLAB and its toolboxes. For Simulink® workflows, use Simulink Agentic Toolkit to extend these capabilities to Simulink.

At a Glance

  • Recommended setup: Use MATLAB Agentic Toolkit with Claude Code. Add Simulink Agentic Toolkit for Simulink workflows.
  • How it works: Agentic toolkits use MATLAB MCP Server to connect Claude to a local MATLAB installation.
  • Requirements: MATLAB Agentic Toolkit requires MATLAB R2021a or later. Simulink Agentic Toolkit requires MATLAB R2023a or later with Simulink. Capabilities depend on installed and licensed products.

Get Started in Three Steps

  1. Download the agentic toolkit installer.
  2. Run the installer to set up the MATLAB and Simulink agentic toolkits and configure Claude Code.
  3. Start Claude Code and begin working with MATLAB and Simulink.
Multibody Explorer pendulum simulation alongside Claude Code validation results confirming all control system requirements passed.

Running simulations with an inverted pendulum Simscape model using Claude Code.

See Claude with MATLAB and Simulink in Action

Watch this demonstration to learn how you can use Claude Code with MATLAB and Simulink across an end-to-end engineering workflow, from defining requirements and designing a controller to simulating, testing, and deploying on hardware.

Choose How You Work

You can use Claude Code with MATLAB from a variety of development environments. The following are a few ways to get started.

Choose a Claude and MATLAB Workflow

Option Best For
Claude Code in the MATLAB terminal Staying in MATLAB while asking Claude to write, run, debug, and test code
Claude in Visual Studio Code Working in an editor-based coding workflow with MATLAB execution available to Claude
Claude Desktop Conversational MATLAB tasks, such as starting MATLAB, running code, and reviewing results

Best Practices for Engineering with Claude

Claude can support engineering tasks ranging from code generation and debugging to analysis and documentation. These best practices can help you get more reliable results while maintaining engineering rigor.

Connect Claude to MATLAB

Use MATLAB Agentic Toolkit to give Claude access to MATLAB tools and guidance. Claude can run and check code, execute tests, inspect installed products, and use MATLAB results to refine its work.

Define the Problem Before Generating Code

Capture requirements, assumptions, units, constraints, expected results, and open questions in the project. For larger tasks, ask Claude to create and refine a plan before implementation.

Work in Small, Reviewable Steps

Break the work into phases, review each change, and use Git™ so you can compare results, preserve traceability, and roll back when necessary.

Make Verification Part of the Task

Ask Claude to check the code, run scripts and tests, and summarize the results. For performance work, provide MATLAB Profiler output and independently verify the proposed changes.

Apply Engineering Judgment

Review generated code and confirm that the results are physically meaningful, numerically sound, safe, and maintainable. Treat MATLAB output and test evidence as the basis for accepting a result.

What Can Claude Do with MATLAB?

Once connected, Claude can work directly with your local MATLAB installation and installed toolboxes.

Common Engineering Tasks with Claude and MATLAB

Engineering Task Description
Modeling and simulation Evaluate designs and analyze system behavior
Algorithm exploration Compare approaches and assess tradeoffs
Testing and validation Verify requirements and explore edge cases
Debugging and diagnostics Investigate and resolve issues
Data analysis and visualization Analyze and visualize results
Workflow automation Automate repetitive engineering work
Technical documentation Generate reports, summarize results, and document engineering decisions
Project exploration Understand existing MATLAB code, Simulink models, requirements, and project architecture

MATLAB and Claude FAQs

Install MATLAB Agentic Toolkit to give Claude Code a live connection to your local MATLAB installation through Model Context Protocol (MCP) tools. You can also configure MATLAB MCP Server separately for Claude Code or Claude Desktop.

Yes. With MATLAB Agentic Toolkit or MATLAB MCP Server, Claude can start MATLAB, write and run MATLAB code, and read the results.

Yes. MATLAB Agentic Toolkit includes support for Claude Code, and MATLAB MCP Server provides the connection to MATLAB.

Yes. Claude Desktop can use MATLAB MCP Server to start and quit MATLAB and to write and run MATLAB code.

Claude can write and run MATLAB code, analyze results, debug errors, review code, run tests, and automate multistep workflows.

Yes. Claude can run code, read the error message, propose a fix, and rerun the code. You should review the final code and results.

Yes. Simulink Agentic Toolkit provides MCP tools and curated skills for design, debugging, testing, simulation, and analysis.

MATLAB Agentic Toolkit, MATLAB MCP Server, and, for Simulink models, Simulink Agentic Toolkit. MCP is the protocol that connects them to Claude.

AI assistants can work with MATLAB as built-in assistants such as MATLAB Copilot, external agents connected through MATLAB Agentic Toolkit and MCP, or language models called from MATLAB code.

Follow the current installation and registration instructions in the MATLAB MCP Server repository, then confirm that Claude Code can start MATLAB. MATLAB Agentic Toolkit is the preferred starting point because it configures the connection and adds curated skills. For Simulink workflows, use Simulink Agentic Toolkit as the preferred starting point.