If you're a fan of data analysis, computational mathematics, and scientific computing, you're likely familiar with MATLAB, a powerful tool widely used by engineers, scientists, and researchers for its versatility and efficiency.

And now, there's an even more accessible way to harness its capabilities: MATLAB Online.

In this blog post, we'll delve into what MATLAB Online is, and guide you through the process of opening it directly from GitHub.

Understanding MATLAB Online 🌎

MATLAB Online is a web-based version of the popular MATLAB software that brings the power of MATLAB to your web browser. It allows you to run MATLAB scripts and functions, create and edit files, visualise data, and collaborate with others - all without the need to install anything on your local machine. This streamlined accessibility makes MATLAB Online an excellent choice for those who may not have access to the full desktop version of MATLAB or prefer a lightweight option for quick tasks.

0:00
/
MATLAB Online is a browser-based version of MATLAB running on the cloud and was used by over 1.5 million people last year. Read more about it here or, better yet, go and have a play with it at https://matlab.mathworks.com/

The Convenience of GitHub 💻

GitHub, on the other hand, is a widely used platform for version control and collaborative development of software projects. It offers a way to host and manage your code repositories, making it easier for teams to work together, track changes, and maintain a history of their codebase. GitHub also supports various programming languages, and MATLAB is no exception.

Create ab "Open in MATLAB" Online Button 👆

You can create links interactively or manually.

Method #1 – Interactively

To create the link interactively, go to Create Links for MATLAB Online.

Opening GitHub Repositories Directly in MATLAB Online
This interactive form enables you to generate a URL for any GitHub repository to automatically open content in MATLAB Online - simple add the generated markdown code to your README file.

Method #2 – Manually

To create the link manually, copy the link template below. Then, replace the template parameters with the information for the repository, as described in the table below.

matlab.mathworks.com/open/github/v1?repo=<authorname>/<reponame>&file=<filename>&project=<projectname>&line=<linenumber>

To omit optional parameters, omit the parameter name and value, as well as the & character that precedes them. For example, this link template omits the project parameter.

matlab.mathworks.com/open/github/v1?repo=<authorname>/<reponame>&file=<filename>&line=<linenumber>

After you create a link, you can distribute it to others, for example, by including it in an email. You also can share the link by creating an Open in MATLAB Online button and including it in a Git README file. To create the button, copy the markdown template below, replacing the link parameter with the link that you created to open the repository in MATLAB Online.

[![Open in MATLAB Online](https://www.mathworks.com/images/responsive/global/open-in-matlab-online.svg)](<link>)

When you add the markdown to a Git README file, the file shows an Open in MATLAB Online button, as shown below.

Adding the "Open in MATLAB Online" button the your repository
Adding the "Open in MATLAB Online" button the your repository

Opening MATLAB Online from GitHub 🖥️

Here's a small summary of how to open MATLAB Online from GitHub.

  1. Accessing the GitHub Repository: Start by navigating to the GitHub repository containing the MATLAB code or files you want to work with. If you don't have the repository URL, you can search for it on GitHub's homepage. Once you're on the repository page, you can explore its contents and even clone the repository to your local machine if desired.
  2. Using MATLAB Online: If the repository contains MATLAB scripts or files that you want to run, simply locate the file of interest. GitHub offers an option to view the content of various file types, including MATLAB scripts, right in your browser. Locate the MATLAB file you want to work with and open it.
  3. Running the MATLAB Code: Once you're viewing the MATLAB script, you'll notice that GitHub offers a user-friendly interface to read and understand the code. To execute the code, click on the "Open in MATLAB" button provided by MATLAB Online. This will seamlessly launch MATLAB Online with the script loaded and ready to run.
  4. Exploring Results: After running the script, you'll be able to explore the results, visualisations, and outputs directly within the MATLAB Online environment. This is incredibly useful for quick analyses and visualisations without needing to install MATLAB on your local machine.
  5. Collaboration and Sharing: One of GitHub's key features is collaboration. You can share the GitHub repository link with colleagues, collaborators, or instructors, allowing them to easily access and run the MATLAB code as well. This promotes seamless teamwork and knowledge sharing.

Conclusion

MathWorks has revolutionised the way we can access, share, and collaborate on MATLAB projects. The ability to open MATLAB code directly from a GitHub repository offers an efficient way to work with MATLAB, whether you're a seasoned coder, a student learning the ropes, or anyone in between. With just a few clicks, you can leverage the power of MATLAB Online and GitHub to execute code, visualise data, and collaborate effectively, all within a web browser.

So, the next time you stumble upon an interesting MATLAB project on GitHub, remember that you can effortlessly open and run it using MATLAB Online. Embrace the synergy of these two platforms and embark on your journey of seamless and collaborative MATLAB programming.


If you’d like to see more blogs about Marketing, consider subscribing to the blog - and leave a comment down below.

Keep engineering your mind! ❤️

Jousef