Skip to content

mlxread

io · scripts/io/mlxread.m

: s = mlxread (filename)
: s = mlxread (filename, name, value, …)

Read a MATLAB Live Script (.mlx) file and return its cells and metadata.

An .mlx file is an Open Packaging Conventions (OPC) ZIP archive. Code and formatted text live in matlab/document.xml; package metadata lives under metadata/.

s is a scalar struct with fields:

Cells

An N-by-1 cell array. Each entry is a struct with field Type ("code" or "text") and, when requested, either Code or Text (character row vector). Text cells also carry Style with the Live Editor paragraph style ("text", "title", "heading", …).

Metadata

A struct with character fields MATLABRelease, MATLABVersion, Title, Created and Modified.

Name-value arguments:

"IncludeCode" (default true)

When false, code cells keep Type but omit the Code field.

"IncludeText" (default true)

When false, text cells keep Type/Style but omit the Text field.

Behaviour note: MATLAB R2026a does not ship a public mlxread M-file or builtin. This Nexus API is a clean-room reader for the documented OPC .mlx layout, sized so later mlxwrite/mlx2m tasks can share the same cell struct.