| MATLAB® | ![]() |
You can modify the desktop configuration to best meet your needs. Refer to Arranging the Desktop first, and then if needed, consult the details in these sections.
To open a tool, select the tool from the Desktop menu. Open tools have a check mark before them in the menu. The tool appears in the location it occupied the last time it was open. The sizes of other open tools adjust to accommodate the newly opened tool. If you close and then open multiple tools sequentially, the location and size when you open them might not be the exactly the same as when you last closed them.
Documents and the tools they are associated with can be part of the desktop. You can open a document and its associated tool as follows:
Variable Editor — Open it by double-clicking a variable in the Workspace browser.
Starting, Customizing, and Closing the Editor — Open it by creating a new text file, such as an M-file, or opening an existing file. For instructions, see Starting, Customizing, and Closing the Editor.
Figures — Create figures using plot and other graphics functions.
You can also open most desktop tools by
Selecting the tool from the Start button Desktop Tools item.
Using a function. For example, type helpbrowser to open the Help browser. These functions are documented with each tool.
The following example shows how the MATLAB® desktop might look with the Command Window, Command History window, Help browser, and the files collatz.m and lengthofline.m open. Because the Command Window is the active window, its title bar is dark blue. By default, the Help browser does not open in the desktop, although you can move it into the desktop (dock it).

The Window menu displays all open desktop tools and documents. Select an entry in the Window menu to go directly to that tool or document. The tool becomes the active window, and when you type, the focus will be there.
This is an example of the Window menu when the Command Window, Command History window, Help browser, and the files collatz.m and lengthofline.m are open.

Use shortcuts and mnemonics to go to a specific tool. For example, type Ctrl+0 to make the Command Window active and Ctrl+Shift+0 to go to the most recently used Editor document. To go to a specific document, type Alt+W and then the mnemonic identifier, for example, A to go to the file collatz.m. Note that the mnemonic identifier for documents is temporary. For example, if you close collatz.m and open it later, the mnemonic might not be A.
Undocked desktop tools also have entries in the Microsoft® Windows® task bar, or the equivalent for your platform. Click the task bar entry for a tool to make that tool active.
You can also run the function that opens a tool, and if the tool is already open, that selects the tool. For example, type helpbrowser to go to the Help browser. These functions are documented with each tool.
To close a desktop tool, do one of the following:
Select the item in the Desktop menu.
Click the Close box
(in the title bar) for
the tool.
Select File > Close Toolname.
Right-click the task bar entry for an undocked tool and select Close.
On Windows platforms, use the standard shortcut, Alt+F4.
Other tools in the desktop adjust their sizes accordingly.
For tools that contain documents, all documents in that tool close as well. For the Editor, a dialog box appears asking you to save any documents that have unsaved changes. If you do not want to see that dialog box and do not want to save any unsaved changes for Editor documents, hold Ctrl and click the Close box.
To resize tools in the MATLAB desktop, use the separator
bar, which is the bar between tools or documents. Move the pointer
onto the separator bar. The pointer assumes a different shape. When
between two tools or documents, it is a double-headed arrow
on Windows platforms,
and an arrow with a bar on UNIX® platforms. When between three
or four documents, it is a four-headed arrow
. Drag the separator bar to change
the sizes of the tools.

To resize the MATLAB desktop itself or any tool outside the desktop, use the convention for your platform. For example, on Windows platforms, drag any edge or corner of the desktop window.
You can also use menu item mnemonics to resize desktop tools using the keyboard. For example, if the Command Window is in the desktop along with other tools, to make the Command Window the active tool, press Ctrl+0 (or click in it). Then press Alt+D, Z, which is the mnemonic equivalent for selecting Desktop > Resize Command Window. The pointer shape becomes an arrow. Use the arrow keys to change the size of the Command Window. Press Enter to accept the new size, or press Esc to return the Command Window to its original size.
To move a tool to another location in the MATLAB desktop, drag the title bar of the tool toward where you want the tool to be located.
As you drag the tool, an outline of it appears. When the outline nears a position where you can dock (keep) it, the outline snaps to that location. Release the mouse button. While you drag the outline, the status bar displays instructions about moving the tool. The inside edges of the desktop container and the edges of all tools all act as if they are "sticky," so you can dock a tool along any inside edge.
In the following example, the Command History window is originally to the left of the Command Window and is being dragged above the Command Window. When the top of the Command History window touches the bottom of the toolbar, the outline appears.

Other tools in the desktop resize to accommodate the new configuration. The following example shows how the desktop looks after the Command History window was moved above the Command Window.

You can also use menu item mnemonics to move desktop tools using the keyboard. For example, if the Command Window is in the desktop along with other tools, to make the Command Window the active tool, press Ctrl+0, or click in it. Then press Alt+D, V, which is the mnemonic equivalent for selecting Desktop > Move Command Window. The pointer shape becomes an arrow. Use the arrow keys to move the outline of the Command Window to a new dockable location. Press Enter to dock it at the new location, or press Esc to return the Command Window to its original position.
Move a tool out of the desktop to make it larger or easier to work with. For example, you might want to move the Help browser outside of the desktop when referring to the online documentation.
To move a tool outside the MATLAB desktop (called undocking), do one of the following:
Click the Undock arrow
in the
title bar of the tool you want to move outside the desktop.
Select Undock for that tool from the Desktop menu; the tool must be the currently active one.
Drag the title bar of the tool outside the desktop. As you drag, an outline of the tool appears outside of the desktop. Release the mouse.
The tool appears outside the MATLAB desktop and an entry for it appears in the Windows task bar. Tools within the desktop resize accordingly.
To move a tool that is outside the MATLAB desktop into
the desktop, click the Dock arrow
in the tool's menu bar,
or select Dock from the tool's Desktop menu. The tool moves into the desktop
and other tools in the desktop resize to accommodate the new tool.
You can group tools so that they occupy the same location in the MATLAB desktop, and then access the individual tools via the tool's name in the titlebar:
To group tools together,
Drag the title bar of one tool in the desktop on top of another tool in the desktop.
The outline of the tool you are dragging overlies the target tool.

Both tools occupy the same space and labeled tabs appear at the bottom of that space.

To view a grouped tool, click the tool's name in the title bar (or any part of the tool's title bar). The tool moves to the foreground and becomes the currently active window.
When you click the Close box
for a tool that grouped
with other tools, that tool closes. You cannot close all the grouped
tools at one time; instead close each tool individually.
Right-click the title bar for a tool and use the context menu to close, undock, maximize, or minimize the tool.
When you open documents used by MATLAB, they open in the associated tool. If the tool is not already open, it opens when you open the document.
How you open a document depends on the document type.
Document Type and Tool | How to Open Document | Where Document Appears by Default | Other Techniques to Open Document |
|---|---|---|---|
M-file (or other text file) in the Editor | Click the Open file button
| In the last location of the Editor. The default location is outside of the desktop. | |
Variable in the Variable Editor | Double-click a variable in the Workspace browser. | In the last location of the Variable Editor. The default location is docked in the desktop. | |
HTML or similar page in the Web browser | Double-click the filename in the Current Directory browser. | In the last location of the Web browser, replacing the existing Web browser document. | |
Figure | The plot function. | In a figure window, outside of the desktop. | Any other function or tool that creates a figure window. |
When you have more than one document open in a tool, each document is either maximized (the default) or positioned so that multiple documents are visible at once.
Click a document that is in view to make it the active document.
To go to an open document that is not in view, select the document name from the Window menu, or from the document bar.
To show the document bar, select Desktop > Document Bar > Bar Position, and select a location, for example, Right. To hide it, select Document Bar > Bar Position > Hide from the Window menu or the document bar context menu.
The document bar shows the names for all open documents docked together in a tool. Select a document name in the document bar to make that document active. You can drag the document bar to another location, or select the new location from the Desktop > Document Bar > Bar Position submenu.
If all the document names do not fit in the document bar, use
the More Documents arrow button
in the document
bar to access additional open documents. Hover over the arrow to automatically
scroll through all of the names, or click the arrow to quickly move
through the names.
By default, the document bar displays a document name using 1/8 of the screen width. If document names are long, or if you have many documents open, the entire document name does not display, but instead, you see the first few characters followed by .... To make a name wider or narrower, for example, to see the entire name, drag the separator bar between two names on the bar when the document bar is on the top or bottom. When the document bar is on the left or right, change the width of the bar by dragging its left or right edge.
To alphabetize the names of the documents in the document bar, right-click in the document bar and select Alphabetize, or select it from the Desktop > Document Bar menu. This is useful if you have many documents open at once. You can also reorder the names by dragging: drag a name to a different position in the document bar. Another way to move document names is to select Move documentname On Bar and select a direction, such as to Beginning from either the Desktop > Document Bar menu or from the document bar context menu.
You can close a document by clicking its Close box in the document bar.
Undocked documents have entries in the Windows task bar. Select an entry to make that document active.
You can position open documents so that only one document or multiple documents are in view within their tool. Select the arrangement from the Window menu or use the buttons on the toolbar. Arrangements are
Maximize
— The default.
Only one document is in view and it occupies the entire area of the
tool. The illustration in Example of Documents in the Desktop shows the maximize arrangement.
Float
— All documents
are in view, layered on top of each other. Use Window > Cascade instead to make a "neatened" floating document arrangement.
Left/Right Tile
—
Two documents are in view, side-by-side.
Top/Bottom Tile
—
Two documents are in view, one above and another below.
Tile
— Multiple documents
are in view, tiled in the tool. When you select this arrangement,
you then move the pointer across the grid submenu to define the number
and position of the tiles, as shown in the following example. You
can select more tiles or fewer tiles than there are open documents.
In the example, there are three open documents, but you need to select
four tiles to make a square grid shape. The tiles that will contain
documents appear blue, whereas the tiles that will be empty appear
gray. On the Apple® Macintosh® platform, this option might
not be available from the Window menu,
so use the toolbar button instead.
See also the Editor's Split Screen Display that allows you to view two different parts of the same file simultaneously.
To position documents using the Window menu, move the mouse across the grid in the Tile submenu and click when the number and location of the tiles highlighted is what you want. This example shows how to select an arrangement so that all three documents will be in view, arranged two above, one below, and with one empty tile.

The following arrangement shows three documents tiled in the Editor, which is undocked from the desktop.

To close an empty tile, move the pointer over the handle
on the separator bar, and then click the Close
box that appears. If you click the handle between two open documents,
both documents stay open, but one moves over the other, covering it
up. Image of tiled documents, highlighting handle on separator bar.

Tile... — This option is available from the Window menu only. It is not available on the toolbar. When you choose this item from the Window menu, you use a dialog box to indicate the documents you want to view and the grid pattern to use for the arrangement of their display. These illustrations show how to specify the arrangement for three variables in three rows in the Variable Editor, and the resulting configuration.


Select Window > Minimize Toolname Documents to "hide" all open documents in that tool. When you select the Float option, you can minimize (hide) a document using the Minimize button in the title bar. To access a minimized document, select its name from the document bar or the Window menu.
To move or resize a maximized document, you actually move or resize the tool.
Resize a floating document by dragging any edge or corner of the window on Windows platforms, or use the convention for your platform. Drag the title bar of a floating document to move it.
To resize documents that use a tiled arrangement, drag the separator bar that is between the documents.
To move a document in a tiled arrangement, drag the title bar of a document to another tile. If you drag it to a tile that already contains a document, the document you are dragging covers up the other document.
If a document is next to an empty tile, you can make the document larger and close the empty tile. Move the pointer onto the handle on the separator bar and click the Close box that appears.
To close a document, click the Close box in that document's title bar. If you select the Close box for the tool, all documents in that tool close. See the following illustration for an example. For Editor documents, if you have unsaved changes, a dialog box appears asking if you want to save the document. If you do not want to see the dialog box and do not want to save any unsaved changes, hold Ctrl and click the Close box.
You can also close documents using any of these methods:
Context menu in a document's title bar
Context menu or Close box for a document in the document bar
Close Toolname Documents items in the Window menu
Close Current_Document_Name in the File menu
The standard shortcut for Windows platforms, Ctrl+F4
For example, in the undocked Editor, select Window > Close Documents to close all documents in the Editor. The Editor remains open with no documents in it, and any undocked Editor documents remain open.
For an undocked document or tools, you can right-click the task bar entry and select Close.
When there are open documents that are not docked within their tools, close all open documents and document tools by selecting Window > Close All Documents from the desktop.

You can undock tools from the desktop (which includes all the documents within it), undock documents from their tools in the desktop, and undock documents from undocked tools. To undock, select the undock arrow for the item from the item's title bar, or use the Undock items from the Desktop menu when the tool is active.
The tool or document moves outside of the desktop and an entry for it appears in the Windows task bar, or the equivalent for your platform. Each type of document has a unique icon in the task bar entry.
If you undock every document from a tool, that tool remains open but "empty."
To dock a tool, click the dock arrow
in the tool's menu bar.
If you dock a tool that includes documents, for example the Editor
and its files, the tool and the documents in the tool move into the
desktop.
If a document is outside of its tool, click the dock arrow in the document's menu bar, or select Desktop > Dock Documentname to move the document into the tool.
To dock all of the documents for a tool together outside of the desktop, dock them all in the desktop, then undock the tool.
Use the document bar in the tool to access documents.
When you end a session, MATLAB saves the desktop layout. The next time you start MATLAB, the desktop is restored the way you left it. This includes reopening any Editor documents you had open.
You can also use predefined layouts, and you can save your own layouts for later reuse.
Any layouts you save are stored as XML files in the preferences directory for MATLAB. The layout last used in a session is MATLABDesktop.xml. Type prefdir in the Command Window to display the location of the XML files. The MATLABDesktop.xml file is loaded when MATLAB starts and is overwritten when you close MATLAB.
Select a predefined MATLAB desktop layout from the Desktop > Desktop Layout menu. Document tools already open in the desktop remain open.
Default — Contains the Command Window and the Command History window, with the Current Directory browser and the Workspace browser tabbed together.
Command Window Only — Contains only the Command Window. This makes MATLAB appear similar to how it looked in older versions.
History and Command Window — Contains the Command History window and Command Window, side by side.
All Tabbed — All tools are opened, maximized, and tabbed together in the desktop.
All but Command Minimized — All tools are opened and minimized in the desktop, except for the Command Window, which is maximized.
After selecting a predefined layout, you can move, resize, and open and close tools.
You can save a desktop layout and use it again at a later time. Select Desktop > Save > Layout to save the current layout. Assign a name to the layout in the resulting dialog box and click OK. To reuse the layout, select Desktop > Desktop Layout and then select the layout name.
To rename or delete a saved layout, select Desktop > Organize Layouts. In the resulting dialog box, select a layout, click the Rename or Delete button, and click Close. When renaming, type the new name over the existing name.
![]() | GUI Reference for Desktop Tools and Development Environment | Adding Your Own Toolboxes to the Development Environment | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |