Documentation

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

NOTEBOOKPATH

Notebook path

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.

Description

The environment variables NOTEBOOKFILE and NOTEBOOKPATH store the absolute file name and the directory name, respectively, of the current notebook in the MuPAD® Notebook as a string.

Possible values: String

The environment variable NOTEBOOKFILE stores the name of the current notebook that is connected to the MuPAD kernel.

The environment variable NOTEBOOKPATH stores the name of the directory where the current notebook is located.

These variables are useful, for example, when reading files that are located relative to the notebook.

Both variables only have a value if the notebook has a name, which is generally the case when an existing notebook has been opened or a new notebook has been saved.

The name given by NOTEBOOKFILE is an absolute file name.

Both variables are read-only and are write-protected. One cannot assign a new value to NOTEBOOKFILE in order to change the name of the notebook.

NOTEBOOKFILE and NOTEBOOKPATH are only defined in the MuPAD Notebook. When using the MuPAD engine from MATLAB®, the two variables are just normal identifiers.

Examples

Example 1

In the MuPAD Notebook, you can specify startup commands for a notebook, which are executed when the notebook is connected to a kernel.

In the startup commands. you can use NOTEBOOKPATH to read a source file “my_init.mu” which is stored in the directory of the notebook:

fread(NOTEBOOKPATH."my_init.mu")

See Also

MuPAD Functions

Was this topic helpful?