What Is a Live Script or Function? - MATLAB & Simulink (original) (raw)

Main Content

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 Functions | Plain Code Scripts and Functions | | | ---------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | | File Formats | Live Code File Format (.mlx)Live Code File Format (.m) (since R2025a) | Plain text | | File Extensions | .mlx.m (since R2025a) | .m | | Output Display | With code in the Live Editor (live scripts only) | In Command Window | | Text Formatting | Add and view formatted text in the Live Editor | Use 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

See Also

Topics