help editorservices
Contents of editorservices: EditorDocument - Encapsulates all user accessible behavior of the MATLAB Editor EditorUtils - Static utility methods for editorservices functions closeGroup - Closes the MATLAB Editor and all open documents. find - returns an already open EditorDocument for a given file name getActive - finds the active (topmost) open buffer in the Editor getAll - Gets all the Editors that are currently open isOpen - true if the specified file is open in the editor new - Creates a new buffer, with optional text open - Opens the MATLAB Editor with the given filename openAndGoToFunction - open a file in the editor and highlight the indicated function openAndGoToLine - open a file in the editor and highlight the indicated line
Please let us know how this new api fits (or doesn’t fit) into your workflows, and what future enhancements you’d like to see and what other Desktop components you’d like to work with programmatically.
October 19th, 2009
Is 7 your lucky number?
I’d like to welcome guest blogger Ken Atwell from the MATLAB Product Management team this week to talk about our support of Windows 7.

Here at The MathWorks we’ve been using and testing MATLAB against pre-releases of Windows 7 for some time now. And we know we’re not the only ones, as we’ve seen thousands of MATLAB activations under Windows 7, even though Windows 7 will not be formally release until the end of this week! I’m happy to report that we’ve fully tested and are now officially supporting the 32-bit and 64-bit versions of R2009a (including Student Version) and R2009b. You can see read our official statement here, and we’ve updated our System Requirements pages in the last several days accordingly.
We expect a smooth MATLAB experience when using these modern releases of MATLAB on Windows 7. We expect older versions of MATLAB to work as well (see our statement for potential gotchas), but is not a supported configuration. If you’re using R2009a, we did find one glitch unique to Windows 7 that was fixed for R2009b: If you shell out to the console with the ! shell escape “operator” in MATLAB, Ctrl+C often will not break out of an operation should you choose to abort it. There is no work-around beyond “don’t do that”. Again, this was resolved for 9b and seems to impact Windows 7 only.
Here are two nice usability improvements that I thought I would share:
- If you mouse over the MATLAB icon in the Windows taskbar, you’ll get thumbnails of all of your MATLAB windows. This may be helpful when you need to locate an undocked Figure window of a GUI that got itself stacked under the MATLAB Desktop or another application.
- The “Windows” key on your keyboard will pop-up the Start menu, which you can quickly filter by typing a character or two in the name of the app you wish to launch. No more hunting through the Program Files hierarchy! For me, Windows->”fi” is enough to find Firefox, Windows->”it” is enough to find iTunes, and (of course) Windows->”ma” finds MATLAB. This is great way to find and launch frequently-used applications while keeping your hands on the keyboard. (And, okay, I admit this feature was introduced in Windows Vista, but it is just too good not to share!)
What are your plans for migrating to Windows 7 (or are you already there)? Any productivity tips for fellow MATLAB users?
-by Ken Atwell, The MathWorks
October 12th, 2009
The history of keyboard shortcuts in MATLAB
I’d like to welcome guest blogger Christina Roberts from the MATLAB Editor team. Christina was the lead developer on the configurable keyboard shortcuts feature.
My last post gave an overview of how to use the new keyboard shortcut preference panel. This post is going to delve into the history of keyboard shortcuts in MATLAB, which will help make it clearer why we decided to change some of our default keyboard shortcut assignments.
The MATLAB desktop was developed over many years by a number of different developers. Although the developers attempted to follow platform standards for common actions, some MATLAB-specific actions were assigned different keyboard shortcuts in different desktop tools, depending on which developer created the tool. A good example of this, illustrated below in the legacy R2009a Windows Default Set, is the Open Selection action available across the desktop. In addition to the four different shortcuts that you can see below, there are a few tools with the action that have no shortcut at all.
Further complicating issues, the original keyboard shortcuts assigned to the Command Window were based on Emacs, regardless of platform. Other platform-specific shortcuts were also added to the Command Window, as long as they did not conflict with existing Emacs shortcuts; for example, Ctrl+O was added on Windows to perform Open, but Ctrl+A could not be assigned to the Command Window’s Select All action because Ctrl+A was the Emacs assignment for moving the cursor to the beginning of the line.
Before long, customers began asking for the ability to configure keyboard shortcuts in the Editor and Command Window, which were the primary desktop tools at the time. To help accommodate those requests, three default sets were developed for the Editor and the Command Window, and users could choose between those sets independently (with the caveat that the Macintosh set was only available on the Macintosh platform). To maintain backwards compatibility, the defaults remained as they had been, even though they were inconsistent between the Editor and the Command Window—the Command Window stayed with the Emacs-based shortcuts on all platforms, but the keyboard shortcut set selected for the Editor by default varied by platform. This was very confusing for new MATLAB users, who expected a more consistent user experience.
As MATLAB continued to evolve, additional tools were added to the desktop, and their keyboard shortcuts were hard-coded to the values that the individual developers felt made sense. So although users appreciated having some choice of keyboard shortcuts in the Editor and Command Window, we continued to receive many requests for customization of individual keyboard shortcuts across the whole desktop. This was particularly needed for customers using certain non-English keyboards, which simply could not trigger some of our default shortcuts.
Presented with the challenge of creating a new keyboard shortcut infrastructure, I had several requirements. I wanted to provide a way to unify keyboard shortcuts across desktop tools so that, by default, the same action had the same shortcut, regardless of where it was triggered. However, I knew that making such a change would introduce backwards incompatibilities and possibly annoy existing MATLAB users, so I wanted to ensure that flexibility existed for customers to achieve exactly the same hybrid configurations that we previously supported. At the same time, this flexibility could not be burdensome to users who desired to quickly change a keyboard shortcut across the desktop, without dealing with individual tools.
So now let’s take a look at the solution that I developed, using the Ctrl+A example discussed above. First, compare the Ctrl+A assignments in the new Windows Default Set to the assignments in the legacy R2009a set.
In R2009a on Windows, Ctrl+A was not assigned to Select All in the Command Window, and instead had the Emacs-based assignment of Cursor Begin Line. Now, let’s assume that you are an existing MATLAB user and you have Ctrl+A committed in your muscle memory to going to the beginning of the line. You have 2 options—you can revert back to the legacy R2009a Windows Default Set, or you can modify the Select All and Cursor Begin Line assignments in the new default set.
Modifying the new default set is a far better long term solution if there are a relatively small number of keyboard shortcuts that are bothering you. If you stick with our new default sets, as new actions and tools are added to the desktop, you will automatically obtain their keyboard shortcuts—this is because we only store the customizations (differences) that you have made from our shipping defaults. In contrast, the legacy sets are complete listings of exactly what we had in release R2009a, and they will not evolve with new features.
So let’s change the assignments related to Ctrl+A in the new Windows Default Set. To do this, first click on Select All and then un-assign the Command Window from the list of tools with the Ctrl+A shortcut.
Then select Cursor Begin Line, press the
button, and add a new shortcut of Ctrl+A to the Command Window only.
If you now search for Ctrl+A in the table of actions, and you will see that the assignments match the ones in R2009a.
That is a quick summary of how the new customizable keyboard shortcuts were developed. I hope that you find this feature useful, and I’d love to hear your feedback!
-by Christina Roberts, The MathWorks
October 8th, 2009
Midweek update: MATLAB Virtual Conference next week October 14th
MathWorks is hosting a MATLAB virtual conference on Wednesday, October 14. It’ll basically be like a regular conference but all the events, meetings, booths, etc will be online.
I will be facilitating forum discussions on MATLAB tips and tricks from 2-3pm and 4-5pm (Eastern). Fellow bloggers Loren and Jiro will also be hosting forum discussions.
October 5th, 2009
Slimming down the Help browser
I’d like to welcome guest blogger Chris Kollett this week from the MATLAB Help team to talk about the redesigned Help Browser.
If you’re a regular user of the Help browser, you’ll notice that its user interface has changed quite a bit in R2009b. One of our main motivations for these changes was to make the Help browser useful in layouts other than its default layout. Time and time again we’ve seen users struggle to use the Editor and Help browser at the same time, because they both work best when they’re laid out relatively wide. Since users can’t get them both on screen at the same time, they end up switching back and forth between them, wasting time and breaking their flow.
If you struggle to see your work and use the Help system at the same time, here are a couple of tips for making the Help browser take up less space in R2009b:
Close the Help navigator
Yes, really, close the Help navigator (the left side of the Help browser, where the table of contents and the search results show up). It used to be that if you closed the Help navigator you wouldn’t be able to navigate the doc at all - the table of contents, demos, and even the search field would go away with it. In R2009b, we’ve moved the search field up into the toolbar when the Help navigator is closed, and even more significantly, we’ve replaced the old location dropdown with a breadcrumb navigation widget that lets you access to the full table of contents and all of the demos from the toolbar. If you’ve always wanted the Help browser to give more space to the documentation without sacrificing so much functionality, R2009b should be a big improvement for you.
Consider a taller, narrower Help browser
Prior to R2009b, it was virtually impossible to use the Help browser once you made it narrow. The Help navigator could only be positioned on the left hand side of the Help browser, and as we discussed above, you lost a ton of functionality if you tried to close it. So if you made the Help browser narrow, you had very little room left to display the documentation. In R2009b, we’ve introduced an alternate layout for the Help browser: if you resize the Help browser so that it’s tall and narrow, the Help navigator moves up above the contents. We’re hoping you’ll find it convenient to try some alternate layouts, like docking the Help browser in a narrow space next to the editor.
Please try out these changes and let us know if they help keep you in your flow - we don’t want you to get bogged down in the Help browser and lose track of your work. We’ll look at some other changes to the Help browser in a later entry.
September 28th, 2009
Configurable keyboard shortcuts have arrived
I’d like to welcome guest blogger Christina Roberts from the MATLAB Editor team. Christina was the lead developer on the configurable keyboard shortcuts feature.
R2009b has a new feature that I am particularly excited about: user-configurable keyboard shortcuts for the MATLAB desktop. This is a project that has been in the works for several years, and I am thrilled that it is now officially released.
I will be splitting up my discussion of this feature into two posts. The first will give a high-level overview of the R2009b functionality, and the second will delve into the somewhat troubled history of keyboard shortcuts in MATLAB. I hope that you will learn some valuable tips from both posts and gain a better understanding of how to leverage customizable keyboard shortcuts.
First, let me explain the layout of the keyboard shortcut preference panel. You can open it from the File Menu: File -> Preferences -> Keyboard -> Shortcuts
The Active settings dropdown list at the top of the preference panel allows you to choose between different keyboard shortcut sets—those that ship with the product, and customized sets that you may obtain from colleagues or MATLAB Central. The shortcut set selected by default matches common keyboard shortcuts on the platform on which you are running. For Windows and Macintosh, these are based on Windows and Macintosh platform standards, respectively. On UNIX, we decided to base our default keyboard shortcuts on the popular Emacs editor; however, if you are more comfortable with Windows-based keyboard shortcuts, that option is also available on UNIX.
The Windows and Emacs sets are both available on non-Macintosh platforms, but the Macintosh Default Set is only available on Macintosh due to the usage of the Command key. In addition to our new default sets, we also ship a set representing the default keyboard shortcuts in R2009a, specific to the platform on which you are running.
To import a customized keyboard shortcut set, choose Browse… from the Active settings combo box and navigate to the location of the set’s XML file. If you would like to share your own customized set, use the Save As… button to create an XML-representation of the set.
The top table of the preference panel lists all the actions that are configurable. You can search the contents of this table using the search field above it. For example, let’s look at the actions relating to pasting an item from the clipboard:
You can see that there are three paste-related actions. The generic Paste action has the keyboard shortcuts Ctrl+V and Shift+Insert. These same keyboard shortcuts are also assigned to Paste to Workspace in the Workspace Browser, as indicated by the informational icon next to the actions as well as their tooltips.
The middle table is where you can change assigned keyboard shortcuts, remove existing assignments, and add new ones. Let’s assume that you want to change Paste’s Ctrl+V shortcut to Ctrl+Shift+P. To do this, click in the table cell displaying Ctrl+V and press your new keyboard shortcut. The text representing the shortcut that you just pressed will then be displayed. Note that you can also insert multi-stroke keyboard shortcuts, popular in Emacs, by selecting Limit to 2 keystrokes from keyboard shortcut editor’s context menu.
If you press the Apply or OK buttons, Ctrl+V will be replaced by Ctrl+Shift+P for all tools which support the Paste action. To see what tools these are, click in the table cell to the right of the new assignment. It is then possible to deselect some of these tools, if you do not wish for Ctrl+Shift+P to be assigned to Paste in all desktop tools.
Now let’s also assign Ctrl+V back to Paste in the Editor only. To do this, press the
button under the middle table. Then press Ctrl+V in the shortcut field, and finally deselect all the tools for that shortcut except the MATLAB Editor.
Finally, the bottom table in the panel shows keyboard shortcut conflicts with the action currently being edited. In the example above, informational icons indicate that there are keyboard shortcuts assigned to Paste which are also assigned to Paste to Workspace. However, since the Workspace Browser does not support the default Paste action, this is not an actual conflict. To create a real conflict, try replacing the Ctrl+Shift+P assignment with Ctrl+P.
When you make that change, an error icon appears, indicating that Ctrl+P is assigned to two or more actions within the same desktop tool. This means that you cannot use Ctrl+P for both Paste and Print, but you can instead choose to unassign Ctrl+P from Print by selecting the first row in the bottom table and pressing the Unassign button.
If you now press the OK or Apply button, your modifications to the Windows Default Set will be retained in subsequent sessions of MATLAB. You can go back to the original Windows Default Set by selecting Restore defaults, or you could write this file out as a custom set by selecting Save As….
That is a quick overview of how the preference panel works. In a future post, I will discuss the history of keyboard shortcuts in MATLAB and explain how we made some of our design choices.
-by Christina Roberts, The MathWorks
September 21st, 2009
The Front Page of the File Exchange: Your Desktop
It may seem backward in late 2009 that one of the great new features in MATLAB is integrating a web application, the MATLAB File Exchange, into the Desktop. However it’s not surprising to me that this arrangement works out quite well. Because the file exchange exists for sharing files created in and to be used in the MATLAB environment, this actually streamlines the workflow. This new tool solves the pain of making files from the exchange available and searchable right there without having to leave MATLAB.
The File Exchange window is not open by default, so to bring it up, use the toolbar menu: Desktop -> File Exchange.
Downloading is quite simple. Let’s say I wanted to download Ken’s breakpoint muting program:
1. Search
2. Download
3. Go

It’s pretty a simple feature, but the convenience factor is really there. You can search for toolbox functions using the Function Browser, and if we didn’t give you a particular function, you can then turn to the File Exchange and see if one of your friends on the web has already done the work for you.
The file exchange is an active and friendly community and if you’ve come up with useful program, we encourage you to share that with the community through the File Exchange web interface. If your program is up to snuff, it may even be chosen as the File Exchange Pick of the Week.
Resources:
- FAQ
- Watch the tutorial video



button in the Workspace Browser.

button and promote that plot to the “Favorites” section, which appears at the top of the Plot Selector.








Recent Comments