MATLAB Answers

How do I go between plain scripts (.m) and live scripts (.mlx)?

585 views (last 30 days)
I would like to convert my Live Editor files to ordinary script files and vice versa, how do I do that?

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 4 Mar 2016
Use the following following conversion steps:
  • Plain to Live: “Open as Live Script” from Current Folder Browser or document tab
  • Live to Plain: “Save as…” and select “MATLAB Code (*.m)”

  5 Comments

Show 2 older comments
Baptiste Ottino
Baptiste Ottino on 7 Aug 2017
Hi John, Hi Sarang,
It is perfectly possible to go between the two formats using the following internal functions (2016b, maybe even 2016a):
From mlx to m:
doc matlab.internal.richeditor.openAndConvert
From m to mlx:
doc matlab.internal.richeditor.openAndSave
I know I'm late on the topic, but I found out by pure luck after countless hours of research, and I hope it will help someone. Best regards.
Sharon Aharon
Sharon Aharon on 29 Jan 2018
be noted that starting from 2017a, internal function for conversion changed from 'richeditor' to ' liveeditor':
so, from mlx to m:
matlab.internal.liveeditor.openAndConvert
etc...
regards.

Sign in to comment.

More Answers (2)

Baptiste Ottino
Baptiste Ottino on 7 Aug 2017
Alternatively, use the command lines:
From mlx to m:
doc matlab.internal.richeditor.openAndConvert
From m to mlx:
doc matlab.internal.richeditor.openAndSave

  0 Comments

Sign in to comment.


J Michael Fitzpatrick
J Michael Fitzpatrick on 7 Mar 2020 at 22:20
Edited: J Michael Fitzpatrick on 7 Mar 2020 at 22:20
To convert from a non-live script to a live scritpt in R2019b:
  • click the down arrow below Save
  • choose "Save As..." and a file navigator will pop up
  • choose the type named, "MATLAB Live Code Files (*.mlx)"
  • click the Save button.

  0 Comments

Sign in to comment.

Sign in to answer this question.