Open in MATLAB Online from GitHub
You can open Git™ repositories directly in MATLAB® Online™ by creating specially formatted links. You can create a link to a Git repository, or to a project or file within a Git repository. Clicking the link creates a clone of the Git repository in MATLAB Online. If a project is specified, MATLAB opens and runs the project. If a file is specified, MATLAB opens the file.
After creating the links, share them by distributing them to others directly, or by
creating Open in MATLAB Online buttons and including them in a
Git
README
file.
Create Links
You can create links interactively or manually.
Interactively
To create the link interactively, go to Create Links for MATLAB Online.
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>
Parameter | Required? | Summary | Example |
---|---|---|---|
| Yes | Author and name of the Git repository | repo=myname/myrepo |
| No | File to be opened after the Git repository is cloned | file=filename.mlx |
| No | Project to be opened after the Git repository is cloned | project=MyProject.prj |
| No | Line to navigate to when specified file is opened | line=88 |
Note
Concurrent access of a Git repository in cloud storage might corrupt the repository.
Share Links
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>)
README
file, the file shows an Open in MATLAB
Online button, as shown below.