Main Content

What Is a Live Script or Function?

MATLAB® live scripts and live functions are interactive documents that combine MATLAB code with formatted text, equations, and images in a single environment called the Live Editor. In addition, live scripts store and display output alongside the code that creates it.

Example live scripts

Differences Between Scripts and Live Scripts

Live scripts and live functions differ from scripts and functions in several ways. This table summarizes the main differences.

 Live Scripts and FunctionsPlain Code Scripts and Functions
File Formats Plain text
File Extensions
  • .mlx

  • .m (since R2025a)

.m
Output DisplayWith code in the Live Editor (live scripts only)In Command Window
Text FormattingAdd and view formatted text in the Live EditorUse publishing markup to add formatted text, publish to view
Visual Representation

Live script with code, output, and formatted text

Plain code script showing code and green commented text

Limitations

  • Before R2019b, the Live Editor is not supported in several operating systems supported by MATLAB.

    Unsupported operating systems include:

    • Red Hat Enterprise Linux 6.

    • Red Hat Enterprise Linux 7.

    • SUSE Linux Enterprise Desktop versions 13.0 and earlier.

    • Debian 7.6 and earlier.

    In addition, some operating systems require additional configuration to run the Live Editor in MATLAB versions R2016a through R2019a. If you are unable to run the Live Editor on your system, Contact Technical Support for information on how to configure your system.

See Also

Topics