Stacks

Upgrade a dependency and fix the breakage in MATLAB with Atlas in 2026

Updated 8 min read

Atlas empowers MATLAB developers in 2026 to efficiently upgrade dependencies and resolve resulting compile and test failures. It directly interacts with your `MATLAB Add-On Manager (mpm)` to update packages, then uses its AI capabilities to interpret compiler output and fix code, ensuring your `matlab.unittest (runtests)` suite passes. This process significantly reduces the manual effort involved in migrating to new major library versions.

How Atlas upgrades MATLAB dependencies using `MATLAB Add-On Manager (mpm)`

In 2026, Atlas simplifies upgrading MATLAB dependencies by directly interfacing with the `MATLAB Add-On Manager (mpm)`. It executes `mpm` commands via its `bash` tool, capturing the full output, which can exceed 100 lines for complex upgrades, to identify new versions and potential conflicts.

Atlas leverages its `bash` tool to run `MATLAB Add-On Manager (mpm)` commands, initiating the dependency upgrade. For instance, you might instruct Atlas to execute `mpm install <package_name> --upgrade`. Atlas captures the complete output from this command, which is crucial for understanding the upgrade's success, any warnings, or initial errors. If the output is extensive, exceeding typical terminal buffer limits, Atlas automatically saves it to a file, which you can then review using the `read` tool. This ensures that no critical information about the new package version or its installation process is missed, providing a solid foundation for subsequent breakage repair.

How Atlas fixes compile errors in MATLAB after a dependency upgrade

After a dependency upgrade, Atlas addresses MATLAB compile errors by interpreting the actual compiler output, not by guessing. It runs your `buildfile.m` or equivalent via `bash`, then uses its `edit` tool to apply precise fixes to the 10s or even 100s of affected call sites, guided by `lsp` for new signatures.

Atlas systematically fixes compile errors by first executing your MATLAB build process using its `bash` tool. This typically involves running a command like `matlab -batch 'run buildfile.m'` or a custom script that invokes `checkCode`. Atlas then parses the real compiler output, identifying specific file paths and line numbers where errors occur in your `.m` files. With this precise information, Atlas employs its `edit` tool to modify the problematic code. For understanding new function signatures or class property changes in the upgraded dependency, Atlas utilizes the `lsp` tool's `goToDefinition` operation. This allows the agent to inspect the new API directly within the upgraded package, ensuring that fixes, such as adjusting function calls or property access, are accurate and align with the new major version's interface. Atlas's code index, built using `tree-sitter` for AST declarations, further enhances its ability to navigate and understand your MATLAB codebase.

How Atlas resolves `matlab.unittest` failures after a MATLAB dependency upgrade

Atlas systematically resolves `matlab.unittest` failures that arise from dependency upgrades, ensuring your codebase remains robust. It executes `runtests` via `bash`, capturing detailed failure reports, and then uses its `edit` tool to modify test classes under `tests/` or production code, often fixing 5 to 15 failing assertions per iteration.

When a dependency upgrade introduces breaking changes that manifest as test failures, Atlas steps in to repair your `matlab.unittest` suite. It uses its `bash` tool to execute your tests, typically with a command like `matlab -batch 'runtests tests/'`. Atlas captures the full output from `runtests`, including detailed assertion failures, stack traces, and file locations. Based on this output, Atlas employs its `edit` tool to modify the relevant `.m` files. This could involve updating `matlab.unittest.TestCase` subclasses in your `tests/` directory to reflect new API behaviors, or adjusting production code that the tests are validating. Atlas works iteratively, fixing a set of failures, re-running the tests, and repeating the process until the entire `matlab.unittest` suite passes cleanly, ensuring the integrity of your MATLAB application.

Ensuring code quality and safety during MATLAB dependency upgrades with Atlas

Atlas prioritizes code quality and safety throughout the dependency upgrade process in MATLAB, offering multiple layers of review and control. Every proposed change, from a single line to 100s of lines across multiple `.m` files, is presented as a unified diff for your approval before being written to disk, and `MATLAB Format Code` is applied.

Atlas is designed with robust safety mechanisms to give you full control over the dependency upgrade process in MATLAB. Before any tool call is executed, it is permission-gated against allow, ask, and deny rules, ensuring you are always aware of and approve Atlas's actions. Atlas drafts a plan in a read-only plan agent, allowing you to review its strategy before it begins making changes. Crucially, every file edit Atlas proposes, whether to a function file or a class definition, is computed as a unified diff and surfaced for your explicit approval. This means you see exactly what changes will be made to your `.m` files before they are written. Furthermore, Atlas can apply `MATLAB Format Code` conventions to all touched files, ensuring that even after extensive modifications, your codebase maintains consistent style. Atlas also integrates with Git, allowing it to read branches, status, and diffs, and can stage and create commits on your behalf, with the ability to snapshot file changes as git patches for easy rollback.

Accessing release notes for MATLAB library migrations with Atlas

When upgrading a MATLAB library to a new major version, understanding breaking changes is crucial. Atlas uses its `webfetch` tool to retrieve the library's release notes or changelog, providing the agent with up to 20,000 characters of context directly from the web, ensuring fixes align with documented changes.

To effectively address breaking changes during a MATLAB dependency upgrade, Atlas can access the library's release notes or changelog. Using its `webfetch` tool, Atlas can navigate to specified URLs and retrieve the content of these documentation pages. This provides the agent with vital context regarding API changes, deprecations, and migration instructions directly from the library maintainers. For example, if a function signature in a core MATLAB toolbox has changed from `oldFunction(arg1, arg2)` to `newFunction(arg2, arg3, 'option')`, the release notes fetched by Atlas inform the agent of this specific change. This contextual awareness allows Atlas to make more intelligent and accurate modifications to your `.m` files using the `edit` tool, ensuring that the fixes align precisely with the actual breaking changes rather than relying on guesswork.

Step by step

  1. 011: Instruct Atlas to upgrade the target dependency using `MATLAB Add-On Manager (mpm)` via the `bash` tool. For example: `atlas bash "mpm install <package_name> --upgrade"`.
  2. 022: Use Atlas's `webfetch` tool to retrieve the release notes or changelog for the upgraded library, providing crucial context for breaking changes. For example: `atlas webfetch "https://www.mathworks.com/help/releases/<library>/rn.html"`.
  3. 033: Have Atlas run your MATLAB build process (e.g., `buildfile.m` or `checkCode`) using `bash` to enumerate initial compile errors. For example: `atlas bash "matlab -batch 'run buildfile.m'"`.
  4. 044: Guide Atlas to fix each compile error in your `.m` files using its `edit` tool, leveraging `lsp` for `goToDefinition` to inspect new signatures. For example: `atlas edit "Fix compile error in myClass.m based on compiler output"`.
  5. 055: Instruct Atlas to run your `matlab.unittest` test suite using `bash` to identify test failures. For example: `atlas bash "matlab -batch 'runtests tests/'"`.
  6. 066: Have Atlas fix failing `matlab.unittest.TestCase` subclasses or related production code in your `.m` files using the `edit` tool, iterating until tests pass. For example: `atlas edit "Repair failing assertion in tests/MyFeatureTest.m"`.
  7. 077: Ask Atlas to apply `MATLAB Format Code` conventions to all modified `.m` files to ensure consistent styling. For example: `atlas bash "matlab -batch 'matlab.desktop.editor.formatDocument(which(''myFunction.m''))'"` (or a script to format all touched files).
  8. 088: Review the unified diff of all changes presented by Atlas, approve them, and then allow Atlas to stage and create a Git commit on your behalf.

Frequently asked questions

How does Atlas handle different MATLAB project structures for upgrades?
Atlas operates within your project folder, reading `.m` files and `buildfile.m`. It uses `bash` to execute your existing build and test commands, adapting to how your specific MATLAB project is structured rather than imposing a new one.
Can Atlas upgrade private MATLAB toolboxes or custom packages?
Yes, if your private toolboxes or custom packages are managed by `MATLAB Add-On Manager (mpm)` or a similar script executable via `bash`, Atlas can drive the upgrade process. It integrates with your existing command-line tools.
What if the MATLAB dependency upgrade introduces complex architectural changes?
Atlas uses `webfetch` to retrieve release notes, providing context for architectural shifts. It then iteratively fixes compile and test failures, allowing you to review each step and guide the agent through more complex refactoring, ensuring the changes align with your design.
How does Atlas ensure my MATLAB code adheres to formatting standards after fixes?
Atlas can apply `MATLAB Format Code` conventions to all files it touches before you approve the changes. This ensures that even after extensive fixes, your `.m` files maintain consistent formatting, reducing the need for manual cleanup.
Is my MATLAB code sent to external servers when using Atlas for upgrades?
No, Atlas can build its code index with local Ollama embeddings, keeping your MATLAB code off third-party servers. All processing, diff generation, and agent operations happen locally on your machine, ensuring data privacy.
How does Atlas prevent unintended changes during a MATLAB dependency upgrade?
Atlas employs a read-only plan agent, permission-gated tool calls, and presents a unified diff for every file edit. You must explicitly approve all changes before they are written to your MATLAB `.m` files, giving you complete control and preventing unintended modifications.
Can Atlas help me understand the new API of an upgraded MATLAB library?
Yes, Atlas uses its `lsp` tool's `goToDefinition` operation. This allows it to inspect the new function signatures, class properties, and method definitions directly within the upgraded MATLAB package, providing immediate context for necessary code adjustments.

Try Atlas in your terminal

The terminal-native AI coding agent. Free core, single binary.

Install Atlas

Related guides

Upgrade a Dependency and Fix the Breakage with Atlas (2026 Workflow)

How to upgrade a dependency and fix the breakage with Atlas in 2026: bash drives the package manager, webfetch pulls the release notes, edit fixes each compiler error.

Review a Pull Request in MATLAB with Atlas in 2026

Atlas helps MATLAB developers in 2026 review pull requests by providing full code context, checking function references, and running matlab.unittest (runtests) for comprehensive bug detection.

Write unit tests for untested code in MATLAB with Atlas in 2026

Add real unit tests to your MATLAB code in 2026 using Atlas. Learn how Atlas leverages matlab.unittest (runtests) and existing repo conventions for robust testing.

Refactor a Legacy MATLAB Module with Atlas in 2026

Modernize your MATLAB codebase in 2026. Atlas helps refactor legacy modules without breaking callers, using matlab.unittest (runtests) and precise code edits.

Document a module with a README in MATLAB with Atlas in 2026

Learn how Atlas helps MATLAB developers in 2026 generate accurate README documentation directly from source code, using `matlab.unittest (runtests)` and `MATLAB Add-On Manager (mpm)`.

Plan a Multi-File Change Before Editing in MATLAB with Atlas in 2026

Design complex, multi-file MATLAB changes and get them reviewed before modifying a single line of code using Atlas's dedicated plan agent and integrated toolchain.

Self-review your working diff before committing in MATLAB with Atlas in 2026

Catch your own mistakes in uncommitted MATLAB code diffs before they reach review or CI. Atlas helps MATLAB developers in 2026 self-review changes, run `matlab.unittest (runtests)`, and apply `MATLAB Format Code` for

Run Atlas Headless in CI for MATLAB Projects in 2026

Automate Atlas in your MATLAB CI/CD pipelines. Get machine-readable output, pre-approve tools, and integrate with matlab.unittest and MATLAB Format Code for efficient, non-interactive code generation and review.

Browse this resource hub