matlab-create-live-script

Create plain-text MATLAB live scripts with rich text, LaTeX equations, and inline figures.

995|122|Updated Apr 3, 2026
One-click install
npx skills add https://github.com/matlab/matlab-agentic-toolkit --skill matlab-create-live-script
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: matlab-create-live-script
Source: https://github.com/matlab/matlab-agentic-toolkit/tree/main/skills-catalog/matlab-core/matlab-create-live-script
Command: npx skills add https://github.com/matlab/matlab-agentic-toolkit --skill matlab-create-live-script

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

Binary .mlx live script files are unfriendly to version control and hard for AI agents to author correctly, and the plain-text .m live script format has strict syntax rules that are easy to get wrong. This Skill encodes the exact markup rules, formatting conventions, and validation workflow needed to produce valid plain-text live scripts that render correctly in the MATLAB Live Editor.

Core Features & Use Cases

  • Plain-text live script authoring: Generate .m files with %[text] markup, section breaks, LaTeX equations, tables, hyperlinks, and a required appendix that render as rich documents in the Live Editor.
  • Binary .mlx conversion: Convert existing binary .mlx files to version-control-friendly plain-text .m live scripts using the MATLAB editor API.
  • Validation and output embedding: Run scripts through evaluate_matlab_code, embed inline outputs with the bundled executeLiveScript script, and verify rendering via HTML export.
  • Use Case: A user asks for a tutorial explaining the discrete Fourier transform with equations and plots. The Skill produces a valid .m live script with centered LaTeX equations, one plot per section, and the required appendix, ready to open in MATLAB R2025a or later.

Quick Start

Create a MATLAB live script named signal-analysis.m that explains sine and cosine waves with equations and one plot per section.

Frequently Asked Questions about matlab-create-live-script

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create a MATLAB live script as a plain-text .m file?

Write a .m file using %[text] lines for formatted text, %% on its own line for section breaks, and single-$ inline LaTeX for equations. End the file with the required %[appendix] block, and it renders as a rich document in the MATLAB Live Editor.

How do I convert a binary .mlx file to a plain-text .m live script?

Open the .mlx file with matlab.desktop.editor.openDocument, call saveAs with a .m target path, then close with closeNoPrompt. The resulting plain-text file is version-control friendly, unlike the binary .mlx format.

Which MATLAB version supports plain-text live scripts?

Plain-text .m live scripts require MATLAB R2025a or later. Earlier releases only support the binary .mlx format, so this authoring approach does not apply to older versions.

Why do LaTeX equations render incorrectly in my live script?

LaTeX commands inside equations need doubled backslashes (\\sin, \\frac) in the saved file. Writing via Bash heredocs collapses \\ to \ and corrupts equations, so use a literal-text tool like Edit, Write, or fwrite instead.

When should I not use a plain-text live script?

Avoid live scripts for regular scripts without rich formatting and for function files. They are intended for tutorials, reports, and analysis notebooks, and interactive controls are not yet supported in the plain-text format.