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.
You can create links interactively or manually.
To create the link interactively, go to Create Links for MATLAB Online.
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 |
---|---|---|---|
repo |
Yes | Author and name of the Git repository | repo=myname/myrepo |
file |
No | File to be opened after the Git repository is cloned | file=filename.mlx |
project |
No | Project to be opened after the Git repository is cloned | project=MyProject.prj |
line |
No | Line to navigate to when specified file is opened | line=88 |
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.
[](<link>)
When you add the markdown to a Git README
file, the file shows an Open in MATLAB Online button.
