Desktop Tools and Development Environment Previous page   Next Page

Creating Shortcuts

This is an example of a shortcut you might create for a project you work on, the Sea Temperature project. When you work on that project, you might want to set up your environment in a certain way by running a series of statements. You create a shortcut called sea_temp_env, which contains the statements. Then when you work on the project, you run the shortcut to execute all of the statements with a single click. The statements are

more on
format long e
cd d:/mymfiles/sea_temp_project
clear
workspace
filebrowser
clc

To create a shortcut, perform the following steps:

  1. From the Start button, select Shortcuts -> New Shortcut.
  1. The Shortcut Editor dialog box appears.

  1. Create the shortcut by completing the dialog box, as shown in the following illustration.
    1. Provide a shortcut name in the Label field, for example, sea_temp_environment.
    2. Put the environment setup statements in the Callback field as shown in the following illustration. Either type them in, or copy and paste or drag them from a desktop tool. Edit the statements as needed. The field uses the Editor/Debugger preferences for key bindings, colors, and fonts. Note that if you copy the statements from the Command Window, the prompt appears in the shortcut, but MATLAB removes the prompt when you save the shortcut.
    3. Assign a category, which is like a directory for organizing shortcuts. Specify sea_temp_project. To add the shortcut to the shortcuts toolbar, select the Toolbar Shortcuts category.
    4. Use the default shortcuts icon , or select your own.
    5. Click Save. MATLAB automatically removes any Command Window prompts (>>) in the Callback field upon saving the shortcuts.

      Image of Shortcut Editor dialog box showing each field in the dialog box with the example values.

  2. MATLAB adds the shortcut to the Shortcuts entry in the Start button, and to the Shortcuts toolbar, if you selected that category.
  1. After creating a shortcut, run it by selecting it from its category in the Start button. You can also run it from the Shortcuts toolbar if you selected the Toolbar Shortcuts category.

    MATLAB maintains shortcut information in the file shortcuts.xml. Type prefdir, and MATLAB displays the location of the file. Most likely, you will not need to access this file, as MATLAB updates the file automatically.

For more information on the options in the Shortcut Editor dialog box, click the Help button.

Additional Ways to Create Shortcuts.   You can also use these methods to create shortcuts:


Previous page  Shortcuts for MATLAB--Easily Run a Group of Statements Running Shortcuts Next page

© 1994-2005 The MathWorks, Inc.