This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

Share Live Scripts and Functions

You can share live scripts and functions with others for teaching or demonstration purposes, or to provide readable, external documentation of your code. You can share the files with other MATLAB® users, or you can share static PDF, HTML, and LaTeX versions of the files for viewing outside of MATLAB.

This table shows the different ways to share live scripts and functions.

Ways to ShareInstructions
As an interactive document

Distribute the live code file (.mlx). Recipients of the file can open and view the file in MATLAB in the same state that you last saved it in. This includes generated output.

MATLAB supports live scripts in Versions R2016a and above, and live functions in Versions R2018a and above.

As a full screen presentation

Open the live script or function, go to the View tab and click the Full Screen button. MATLAB opens the file in full screen mode.

To exit out of full screen mode, move the mouse to the top of the screen to display the View tab and click the Full Screen button again.

With users of previous MATLAB versions

Save the live script or function as a plain code file (.m) and distribute it. Recipients of the file can open and view the file in MATLAB. MATLAB converts formatted content from the live script or function to publish markup in the new script or function.

For more information, see Save Live Scripts and Functions as Plain Code.

As a static document capable of being viewed outside of MATLAB

Export the script or function to a standard format. Available formats include PDF, HTML, and LaTeX.

To export your live script or function to one of these formats, on the Live Editor tab, select Save > Export to PDF, Save > Export to HTML, or Save > Export to LaTeX.

The saved file closely resembles the appearance of your live script or function when viewed in the Live Editor with output inline.

When exporting to LaTeX, MATLAB creates a separate Extensible Stylesheet Language (XSL) file in the same folder as the output document, if one does not exist already. XSL files give you more control over the appearance of the output document. For more details, see http://docbook.sourceforge.net/release/xsl/current/doc/.

Related Topics