Documentation

This is machine translation

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

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

collapse all

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'

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 character vectors.

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

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 character vector by using char.

Create a new notebook with the handle nb:

nb = mupad;

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

titleAsStr = char(mupadNotebookTitle(nb));

Use the title the same way as any character vector:

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

Related Examples

Input Arguments

collapse all

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

collapse all

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.

Introduced in R2013b

Was this topic helpful?