Edit MuPAD Code in MATLAB Editor


MuPAD® notebooks will be removed in a future release. Use MATLAB® live scripts instead.

To convert a MuPAD notebook file to a MATLAB live script file, see convertMuPADNotebook. MATLAB live scripts support most MuPAD functionality, although there are some differences. For more information, see Convert MuPAD Notebooks to MATLAB Live Scripts.

The default interface for editing MuPAD code is the MATLAB Editor. Alternatively, you can create and edit your code in any text editor. The MATLAB Editor automatically formats the code and, therefore, helps you avoid errors, or at least reduce their number.


The MATLAB Editor cannot evaluate or debug MuPAD code.

To open an existing MuPAD file with the extension .mu in the MATLAB Editor, double-click the file name or select Open and navigate to the file.

After editing the code, save the file. Note that the extension .mu allows the Editor to recognize and open MuPAD program files. Thus, if you intend to open the files in the MATLAB Editor, save them with the extension .mu. Otherwise, you can specify other extensions suitable for text files, for example, .txt or .tst.

Comments in MuPAD Procedures

Enter a comment in a .mu file by entering the // characters. All text following the // on the same line is ignored. The // characters do not affect text on succeeding lines. To create a multi-line comment, start with the /* characters and end the comment with the */ characters. All text between these characters is ignored. You can nest comments using /* and */.