Documentation

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.

Live Scripts and Functions

Live Editor program files with embedded output and formatted text

Live scripts and live functions are program files useful for interacting with a series of MATLAB® commands. Live scripts contain output and graphics with the code that produced them, together in a single interactive environment called the Live Editor. Live functions provide additional flexiblility, allowing you to pass input values and return output values. You can add formatted text, images, hyperlinks, and equations to live scripts and functions to produce an interactive narrative that can be shared with others.

For more information about live scripts and functions, including incompatibilities and information about the Live Code file format, see What Is a Live Script or Function?.

Topics

What Is a Live Script or Function?

MATLAB live scripts and live functions are interactive documents that combine MATLAB code with embedded output, formatted text, equations, and images in a single environment called the Live Editor.

Run Sections in Live Scripts

Divide live scripts into sections and run all sections or run each section individually.

Create Live Functions

Create live functions in the Live Editor with formatted text, images, and equations.

Add Help for Live Functions

Add help text to live functions that displays when you use the help and doc functions.

Add Interactive Controls to a Live Script

Add sliders and drop-downs to live scripts to control variable values interactively.

Debug Code in the Live Editor

Diagnose problems in live scripts and functions using different debugging methods.

Share Live Scripts and Functions

Share live scripts and functions with other MATLAB users, or as static PDF, HTML, and LaTeX files for viewing outside of MATLAB.

Live Code File Format (.mlx)

The Live Code file format (.mlx) uses Open Packaging Conventions technology, which is an extension of the zip file format.

Was this topic helpful?