Notebook Files and Program Files


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 two main types of files in MuPAD are:

  • Notebook files, or notebooks

  • Program files

A notebook file has the extension .mn and lets you store the result of the work performed in the MuPAD Notebook. A notebook file can contain text, graphics, and any MuPAD commands and their outputs. A notebook file can also contain procedures and functions.

By default, a notebook file opens in the MuPAD Notebook. Creating a new notebook or opening an existing one does not automatically start the MuPAD engine. This means that although you can see the results of computations as they were saved, MuPAD does not remember evaluating them. (The “MuPAD Workspace” is empty.) You can evaluate any or all commands after opening a notebook.

A program file is a text file that contains any code snippet that you want to store separately from other computations. Saving a code snippet as a program file can be very helpful when you want to use the code in several notebooks. Typically, a program file contains a single procedure, but it also can contain one or more procedures or functions, assignments, statements, tests, or any other valid MuPAD code.


If you use a program file to store a procedure, MuPAD does not require the name of that program file to match the name of a procedure.

The most common approach is to write a procedure and save it as a program file with the extension .mu. This extension allows the MATLAB Editor to recognize and open the file later. Nevertheless, a program file is just a text file. You can save a program file with any extension that you use for regular text files.

To evaluate the commands from a program file, you must execute a program file in a notebook. For details about executing program files, see Read MuPAD Procedures.