Loren on the Art of MATLAB

Turn ideas into MATLAB

Note

Loren on the Art of MATLAB has been archived and will not be updated.

The MATLAB R2012b Desktop – Part 2: Customizing the R2012b MATLAB Desktop

Today, David Garrison, our guest blogger, will continue his series on the R2012b Desktop.

  • Part 1: Introduction to the Toolstrip
  • Part 2: Customizing the R2012b MATLAB Desktop
  • Part 3: MATLAB Apps

Here is Part 2 of the series.

Contents

What have we learned so far?

In Part 1 of this series, I provided an introduction to the new Toolstrip in MATLAB R2012b. I described the basic organization of the Toolstrip, the concepts of global and contextual tabs, and other ways that the Toolstrip adjusts to your current working context. Today, we'll talk about new ways to customize the R2012b Desktop.

Customizing the R2012b Desktop

MATLAB has historically provided a number of ways to manage the configuration of your Desktop. You can move windows around, resize them, even undock windows from the main Desktop. You can still do all of those things in R2012b and they pretty much work the same way. The only change in R2012b is that the window controls (maximize, minimize, undock, etc.) have been moved from the window's title bar to a drop down menu in the upper right hand corner of each window. The figure below shows the difference between R2012a and R2012b.

In Part 1, we described how to minimize and restore the Toolstrip. Minimizing the Toolstrip can be very useful when you need to maximize vertical space. But minimizing the Toolstrip is only the tip of the iceberg. There are several new ways in R2012b to customize your Desktop which we'll cover in the following sections.

The Current Folder Toolbar

If you look carefully at the picture above of the Current Folder in R2012b, you'll notice something else that's different. In R2012b, the toolbar in the Current Folder is not there. Don't worry, it hasn't disappeared, it's just in a different place. In R2012b, it's default location is below the Toolstrip. We moved it because in previous versions it could only be as wide as the Current Folder. By putting it under the Toolstrip, it's now as wide as your Desktop. This is very useful if you want to add additional buttons to your Current Folder Toolbar or if your current path happens to be long. Here's what it looks like in R2012b with some extra buttons that I use for easy access to MATLAB reports.

You can put the toolbar back inside the Current Folder if you want. However, I like the new position much better because it provides so much more room. To add extra buttons to the Current Folder Toolbar, right-click on it and then select "Customize...".

The Quick Access Toolbar

By now, you've probably noticed the light blue toolbar in the top right hand corner of the R2012b Desktop. That's called the Quick Access Toolbar. It's there to provide single click access to the Toolstrip functionality you use most often.

When you open MATLAB R2012b for the first time you'll notice that the Quick Access Toolbar is pre-populated with controls that are used throughout the Desktop including cut/copy/paste and undo/redo. These are useful things, of course, but there's more. Any control from the Toolstrip tabs can be placed in the Quick Access Toolbar so Toolstrip functionality is available to you anytime.

Let's imagine you're working on a project where you have to analyze a lot of data from files. To get your data into MATLAB, you will need to have easy access to the Import Tool. From the Home tab, you would simply right click on "Import Tool" and select "Add to Quick Access Toolbar".

Maybe you will also use box plots as part of your statistical analysis. From the Plots tab, you would right click on "boxplot" and add it to the Quick Access Toolbar. Any plot in the pulldown gallery of plots can be added in the same way.

Finally, your project will require that you do some curve fitting. For that, you would go the Apps tab and right click on "Curve Fitting" and add it to the Quick Access Toolbar.

After adding these three controls, your Quick Access Toolbar would look like this:

You can also add controls from Contextual tabs like the Editor. For example, you may want to have debugging controls easily accessible if you are debugging your code when the Editor is closed. Any control from the Toolstrip, even those in drop-down menus, can be added to the Quick Access Toolbar. You can even add your own shortcuts to the Quick Access Toolbar. More on that in the next section.

Removing icons is just as easy. Just right click on any icon in the Quick Access Toolbar and select "Remove from Quick Access Toolbar". Let's suppose you use keyboard shortcuts for cut, copy, paste, and other common operations. You can remove them as shown below. You can always put them back if you change your mind.

If you want to do more extensive customization, right-click anywhere in the Quick Access Toolbar and select "Customize..." A dialog box will appear that will allow you to add or remove items, rearrange the icons, or restore the factory defaults.

You may be wondering what happens if you want to add a lot of items to the Quick Access Toolbar. It looks like the Quick Access Toolbar has limited space. Happily, you can move the Quick Access Toolbar so it appears below the Toolstrip. By moving it below the Toolstrip, your Quick Access Toolbar can be as wide as your Desktop. If you do that it will look something like this:

Note that the Quick Access Toolbar and the Current Folder Toolbar can be together on a single line or on two separate lines like I've shown here.

If you're like me, you may find that you don't always remember what all those icons do. If that's the case, right click on any icon and select "Show Label". Using labels allows you to easily find what you need even if your Quick Access Toolbar has many items in it.

If you've put your most commonly used commands in the Quick Access Toolbar and only occasionally go back to the Toolstrip, you can minimize the Toolstrip to get a Desktop configuration that looks something like this.

Managing Shortcuts in R2012b

So now let's talk about shortcuts. Shortcuts are small bits of MATLAB code that can be assigned to an icon in the MATLAB Desktop for single-click access. Shortcuts have been in MATLAB for a while. You can still create and use shortcuts in R2012b. They work the same -- they're just managed a bit differently.

There are several ways to create a shortcut -- from the New menu on the Home tab, from the Command History, and from the Quick Access Toolbar. When you create a shortcut, you will see the Shortcut Editor dialog.

The Shortcut Editor alows you to give your shortcut a name, add your MATLAB code, and select an icon. You can also specify if you want your Shortcut to appear in the Quick Access Toolbar. Once you create your first shortcut, you'll notice that a new Shortcuts tab appears.

Any shortcuts you had in your previous version of MATLAB will be available when you use R2012b. If you have a lot of shortcuts, you can use "Organize Shortcuts" on the Shortcuts tab. Clicking on "Organize Shortcuts" will display the Shortcuts Organizer dialog where you can create new categories and arrange your shortcuts. The categories you create will appear as sections on the Shortcuts tab. Here is an example.

Put your shortcuts in the Quick Access Toolbar for single click access. If you have a lot of shortcuts put the Quick Access bar below the Toolstrip like we did in the example above. You can also hide (or show) the Shortcuts tab. Go to the Environment section of the Home tab and select Layout->Shortcuts Tab.

Have you customized your R2012b Desktop?

We've added a lot of new customization features in the R2012b MATLAB Desktop. Have you tried out the Quick Access Toolbar or the new Shortcuts tab? How do you like to organize your Desktop? I'd love to hear your thoughts here.

Next up -- Part 3: MATLAB Apps

As you can see, there are several new ways to customize your Desktop in R2012b. Try out some of the things we talked about. Next time we'll talk about another big new feature in R2012b - MATLAB apps.




Published with MATLAB® R2012b


  • print

评论

要发表评论,请点击 此处 登录到您的 MathWorks 帐户或创建一个新帐户。