Live scripts are program files useful for interacting with a series of MATLAB® commands and their output. Live scripts contain output and graphics with the code that produced them, together in a single interactive environment called the Live Editor. Add formatted text, images, hyperlinks, and equations to your live scripts to produce an interactive narrative that can be shared with others.
For more information about live scripts, including incompatibilities and information about the Live Script file format, see What Is a Live Script?.
A MATLAB live script is an interactive document that combines MATLAB code with embedded output, formatted text, equations, and images in a single environment called the Live Editor. You can use live scripts to visually explore and analyze problems, to share richly formatted, executable narratives, and to create interactive lectures for teaching.
Create a live script to write your code and view the generated output and graphics with the code that produced it. Add formatted text, images, hyperlinks, and equations to your live script to create an interactive narrative that can be shared with others.
Live scripts often contain many commands and lines of text. For easier document management and navigation, divide your file into sections.
You can share live scripts with other MATLAB users,
or as static PDF
and HTML
files
for viewing outside of MATLAB.
Insert Equations into Live Scripts
Insert equations into your live script to describe a mathematical process or method used in your code.
Add functions to scripts to reuse code within a script and avoid creating and managing separate function files.
Live Script File Format (.mlx)
The Live Script file format (.mlx
)
uses Open Packaging Conventions technology, which is an extension
of the zip file format.