MuPAD® notebooks are not recommended. Use MATLAB® live scripts instead.
MATLAB live scripts support most MuPAD functionality, though there are some differences. For more information, see Convert MuPAD Notebooks to MATLAB Live Scripts.
To close notebooks from the MATLAB Command Window, use
close function and specify
the handle to that notebook. For example, create the notebook with
nb = mupad;
Now, close the notebook:
If you do not have a handle to the notebook (for example, if
you created it without specifying a handle or accidentally deleted
the handle later), use
return handles to all currently open notebooks. This function returns
a vector of handles. For example, create three notebooks without handles:
mupad mupad mupad
allMuPADNotebooks to get a vector of
handles to these notebooks:
nbhandles = allMuPADNotebooks
nbhandles = Notebook1 Notebook2 Notebook3
Close the first notebook (
Close all notebooks:
If you modify a notebook and then try to close it, MuPAD brings
up the dialog box asking if you want to save changes. To suppress
this dialog box, call
close with the
You might want to use this flag if your task requires opening many
notebooks, evaluating them, and then closing them. For example, suppose
that you want to evaluate the notebooks
myFile10.mn located in your current folder.
First, open the notebooks. If you do not have any other notebooks
open, you can skip specifying the handles and later use
Otherwise, do not forget to specify the handles.
mupad('myFile1.mn') mupad('myFile2.mn') ... mupad('myFile10.mn')
Evaluate all notebooks:
When you evaluate MuPAD notebooks, you also modify them.
Therefore, when you try to close them, the dialog box asking you to
save changes will appear for each notebook. To suppress the dialog
box and discard changes, use the