Department of Engineering

IT Services

Cambridge University Engineering Department - Matlab's desktop

Matlab's desktop

When Matlab starts, it may create several windows. This document is about what those windows do and how to control them.

Starting Matlab from the command line

Matlab on linux can be started in various ways

  • matlab - This runs matlab in the default way. On our teaching system this runs matlab's "desktop"
  • matlab -nodesktop - This uses the current window for commands rather than starting the desktop. It starts Java behind the scenes - this is needed so that some features (e.g. the "edit axes" menu-item) work
  • matlab -nojvm - This uses the current window for commands. It doesn't start the desktop or Java. Start-up time will be faster, but some features won't work.

The desktop components

menu You may not want all of the windows that matlab starts. You can select the ones you want by using the desktop menu item. You probably can't do without the "Command Window" - that's where you type commands. The "Command History" (which shows what you've previously typed) and "Current Directory" (which show the files in your current folder) are less useful. In the menu illustrated on the left they've been switched off, as has the "Profiler". The Profiler's useful when you want to speed up your programs. The "Help" panel offers much more help than the matlab command-line's "help" does. We'll look at the "Workspace" in more detail later. The options you choose in this menu are preserved for future sessions.

menu You can also use the "Desktop Layout" sub-menu to choose which layout you want. If you want to store a particular layout for later use (for example, when you have to debug code you might want a special layout) you can use the "Save Layout..." option.

menu The "All Tabbed" option shows you one panel at a time, but lets you switch quickly to another panel by using the tabs at the bottom of the window (see the window to the left).

The workspace

workspaceThis screen shows a command window (bottom right) where a matrix x has been created. The matrix also appears in the workspace (on the left - it shows some information that the whos command displays). One benefit of using the workspace is that by double-clicking on a matrix name you can start the "array editor" (top right). This lets you edit the matrix in a "spreadsheet" format, and you can plot selected elements much as you can with a spreadsheet.