Live Scripts and Functions
实时脚本和实时功能是程序文件,可用于与一系列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 flexibility, 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.
有关实时脚本和功能的更多信息,包括无兼容性和有关实时代码文件格式的信息,请参见什么是实时脚本或功能?.
To explore existing live scripts from the MATLAB community, see theMATLABLive Script Gallery.
Functions
export |
Convert live script or function to standard format |
Topics
- 什么是实时脚本或功能?
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.
- Create and Run Sections in Code
Divide MATLAB code files 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
和doc
功能。 - Add Interactive Controls to a Live Script
Add sliders, drop-downs, check boxes, edit fields, and buttons to live scripts to control variable values interactively.
- Add Interactive Tasks to a Live Script
Add tasks to live scripts to explore parameters interactively and generate code.
- Share Live Scripts and Functions
Share live scripts and functions with other MATLAB users, or as static PDF,Microsoft®Word, HTML, and LaTeX documents for viewing outside of MATLAB.
- Compare and Merge Live Scripts and Functions
View and merge changes between two live scripts or functions.
- 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.