Quantcast

Documentation Center

  • Trial Software
  • Product Updates

mupadNotebookTitle

Window title of MuPAD notebook

Syntax

Description

example

T = mupadNotebookTitle(nb) returns a cell array containing the window title of the MuPAD® notebook with the handle nb. If nb is a vector of handles to notebooks, then mupadNotebookTitle(nb) returns a cell array of the same size as nb.

Examples

expand all

Find Titles of Particular Notebooks

Knowing the handles to notebooks, find the titles of these notebooks.

Suppose that your current folder contains MuPAD notebooks named myFile1.mn and myFile2.mn. Open them keeping their handles in variables nb1 and nb2, respectively. Also create a new notebook with the handle nb3:

nb1 = mupad('myFile1.mn')
nb2 = mupad('myFile2.mn')
nb3 = mupad
nb1 = 
myFile1

nb2 = 
myFile2

nb3 = 
Notebook1

Find the titles of myFile1.mn and myFile2.mn:

mupadNotebookTitle([nb1; nb2])
ans = 
    'myFile1'
    'myFile2'

List Titles of All Open Notebooks

Get a cell array containing titles of all currently open MuPAD notebooks.

Suppose that your current folder contains MuPAD notebooks named myFile1.mn and myFile2.mn. Open them keeping their handles in variables nb1 and nb2, respectively. Also create a new notebook with the handle nb3:

nb1 = mupad('myFile1.mn')
nb2 = mupad('myFile2.mn')
nb3 = mupad
nb1 = 
myFile1

nb2 = 
myFile2

nb3 = 
Notebook1

Suppose that there are no other open notebooks. Use allMuPADNotebooks to get a vector of handles to these notebooks:

allNBs = allMuPADNotebooks
allNBs = 
myFile1
myFile2
Notebook1

List the titles of all open notebooks. The result is a cell array of strings.

mupadNotebookTitle(allNBs)
ans = 
    'myFile1'
    'myFile2'
    'Notebook1

Return a Single Notebook Title as a String

mupadNotebookTitle returns a cell array of titles even if there is only one element in that cell array. If mupadNotebookTitle returns a cell array of one element, you can quickly convert it to a string by using char.

Create a new notebook with the handle nb:

nb = mupad;

Find the title of that notebook and convert it to a string:

titleAsStr = char(mupadNotebookTitle(nb));

Use the title the same way as any string:

disp(['The current notebook title is: ' titleAsStr]);
The current notebook title is: Notebook1

Input Arguments

expand all

nb — Pointer to MuPAD notebookhandle to notebook | vector of handles to notebooks

Pointer to MuPAD notebook, specified as a MuPAD notebook handle or a vector of handles. You create the notebook handle when opening a notebook with the mupad or openmn function.

You can get the list of all open notebooks using the allMuPADNotebooks function. mupadNotebookTitle accepts a vector of handles returned by allMuPADNotebooks.

Output Arguments

expand all

T — Window title of MuPAD notebookcell array

Window title of MuPAD notebook, returned as a cell array. If nb is a vector of handles to notebooks, then T is a cell array of the same size as nb.

See Also

| | | | | |

Was this topic helpful?