Skip to content

This repository show different ways you can configure your dev containers to run MATLAB in codespaces.

License

Notifications You must be signed in to change notification settings

zainh-mw/matlab-codespaces

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Run MATLAB in GitHub Codespaces

This repository shows how to run MATLAB® in GitHub™ Codespaces, so you can quickly start a development environment for developing the MATLAB code hosted in your Github repository.

Table of Contents

When Should I Use MATLAB in Codespaces?

A codespace (GitHub Docs) is a development environment you run in the cloud. If you own a Github repository hosting MATLAB code, users of your repository can use Codespaces to:

  • Configure a consistent and customizable development environment.
  • Run MATLAB along with other software or programming languages.
  • Use Git to contribute back to your repository.

Choose a Configuration

Codespaces run in Docker containers called development containers, or dev containers (GitHub Docs). You can customize how MATLAB is installed in your codespace by modifying the configuration file of the dev container, named devcontainer.json. Choose the configuration that corresponds to your desired use case.

Use Case Recommendation Start Codespace Using Recommended Configuration
Use MATLAB only Use a prebuilt MATLAB Container on Docker Hub.

Configure your codespace using this devcontainer.json.
Open in GitHub Codespaces
Customize MATLAB installation with specific toolboxes or other software Create a custom MATLAB container image using MATLAB Dockerfile. You can see an example Dockerfile in the .devcontainer/using-matlab-dockerfile folder.

Configure your codespace using this devcontainer.json.
Open in GitHub Codespaces
Add MATLAB to an existing devcontainer configuration Use the MATLAB Feature for Devcontainers.

Configure your codespace using this devcontainer.json.
Open in GitHub Codespaces

Use MATLAB in Codespaces

Use your MATLAB codespace to:

  • Run & Debug .m files in VS Code
  • Run MATLAB code in Jupyter Notebooks in both VS Code and JupyterLab
  • Switch to the MATLAB IDE to use more MATLAB features.

By default, your MATLAB codespace starts in a Visual Studio Code environment, and MATLAB opens in a browser tab.

VSCode In Codespaces

For details on using MATLAB in VS Code in your codespace, see What Can I Do With MATLAB in VS Code?

For details on using MATLAB in JupyterLab in your codespace, see What Can I Do With MATLAB in JupyterLab?

What Can I Do With MATLAB in VS Code?

Once you have MATLAB set up in your codespace, you can use VS Code to:

  1. Run & Debug MATLAB files in the VS Code editor.

    Run and Debug MATLAB in VS Code

    For more information, see MATLAB Extension for Visual Studio Code.

  2. Access MATLAB in a browser tab.

    MATLAB Proxy

    For more information on using MATLAB in the browser, see MATLAB Proxy.

  3. Run MATLAB code in Jupyter Notebooks within VS Code.

    You can run MATLAB code in Jupyter Notebooks, within the VS Code environment. For more information about VS Code support for Jupyter Notebooks, see Jupyter Notebooks in VS Code (VS Code).

    Jupyter Notebook In VS Code

What Can I Do With MATLAB in JupyterLab?

The configurations in Choose a Configuration enable you to run MATLAB in JupyterLab as well as VS Code:

Open In JupyterLab

After opening JupyterLab in your codespace, you can:

  1. Run MATLAB code in Jupyter Notebooks.

    Run MATLAB code using Jupyter Notebooks

  2. Access MATLAB in a browser window.

    Access the MATLAB in a browser window

Related Links


Copyright 2024-2025 The MathWorks, Inc.


About

This repository show different ways you can configure your dev containers to run MATLAB in codespaces.

Resources

License

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Dockerfile 100.0%