MATLAB Answers

1

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

I would like to convert my Live Editor files to ordinary script files and vice versa, how do I do that?

2 Answers

Answer by MathWorks Support Team on 4 Mar 2016
 Accepted Answer

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

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.
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.
Thanks, Baptiste, thanks Sharon.

Sign in to comment.


Answer by 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.