Share Live Scripts

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

This table shows the different ways to share live scripts.

If you want to ...Instructions
Share your live script as an interactive document.

Distribute the live script 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. You can open live scripts as code only files in MATLAB versions R2014b, R2015a, and R2015b.

    Caution   Saving a live script in MATLAB versions R2014b, R2015a, and R2015b causes all formatted text, images, hyperlinks, equations, and generated output content to be lost.

Share your live script with users of previous MATLAB versions.

Save the live script 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 to publish markup in the new script.

For more information, see Save Live Script as Script.

Share your live script as a static document capable of being viewed outside of MATLAB.

Export the script to a standard format. Available formats include PDF and HTML.

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

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

Related Examples

Was this topic helpful?