Skip to Main Content Skip to Search
File Exchange
MATLAB Newsgroup
Link Exchange
  Blogs  
 Contest 
MathWorks.com

Inside the MATLAB Desktop

December 3rd, 2007

Start Up Your M-Files in Style

Looking for a way to integrate your code into the MATLAB Start button? Welcome to info.xml!

In just a few easy steps you can hook up your collection of m-files. MATLAB collects information for the Start button menu from info.xml files. All you need is one of these files in the directory with your code and that directory on the MATLAB search path. You can even give the info.xml files to friends, along with your M-files, and they can access your code from the Start button too.

    1. To make things easy for you there’s an example file in <matlabroot>\help\techdoc\matlab_env\examples\startinfo.xml. Copy this file into your directory and rename it to info.xml.
    2. Add this directory to your MATLAB search path.
    3. Let’s view the info.xml before making any changes. Select Start > Desktop Tools > View Start Button Configuration Files. You’ll need to click the Refresh Start Button to see this new info.xml and again later after modifying an existing info.xml.
    4. In the Start Button Configuration Files dialog box, select the info.xml you just created (your new info.xml is named SpecSim (Example) Toolbox).
    Start Button Configuration Dialog
    5.Click the Open button to view the file in the Editor.
    info.xml File
    6. Change the name from SpecSim (Example) to something unique and representing your M-file collection. (click Refresh Start Button in the Start Button Configuration Files dialog box). Notice that your named collection now appears in the Start > Toolboxes menu.
    7. Now move/change/add other entries in the info.xml so they pertain to your code and are placed on the Start menu where you prefer. The first level of the start menu provides basic groups of products/functionality such as MATLAB, Simulink, Toolboxes etc. You decide which of these groups your menu will be listed in. This value is placed next to the type tag.

For each main menu representing a collection of m-files you can specify:

  • matlabrelease - this value is your versioning information, it’s currently not used
  • name - name of your main menu
  • type - name of the menu group your main menu will cascade from. (allowable values are: matlab, simulink, toolbox, blockset, links_targets, other)
  • icon - path to an icon to display next to your main menu
  • help_location - path to HTML help files for your code

For each main menu you can create a list of items (listitems) listed on a sub-menu off of your main menu. In addition to menu items launching your m files, you can add items for things such as demos and examples.

  • label - name to be listed on you main menu
  • callback - the function that is run when the menu time is selected
  • icon - the icon that shows up next to your menu item

Here’s an example:

Lori’<p><p>s info.xml File

And the start menu…

Start Menu

Now you can show off your code in style. By the way did you notice the XML syntax highlighting? The first person to return instructions on how to get the MATLAB Editor to highlight XML will receive a t-shirt!

We’d love to hear what you think about the Start Button. Leave a comment here.

2 Responses to “Start Up Your M-Files in Style”

  1. K Morton replied on :

    The instructions were posted on this blog back in Sept.

    http://blogs.mathworks.com/desktop/2007/09/04/editor-syntax-colors-for-non-m-file-types/

  2. Ken replied on :

    You got it…just wanted to see if anyone was paying attention!

    As I noted back in September, full XML support is coming soon.

    (I’ll email you to get your t-shirt info)

Leave a Reply


Inside the MATLAB Desktop is written by the MATLAB Interface teams.

Team picture
  • Ken: Hi Bjoern, We’re currently working hard to make it easier to add support for additional languages in the...
  • Bjoern: Hi, As all the other matlab users out there who have to work with different programming languages - I would...
  • Mike: bswang, Depending on where your data is coming from, it may not be available from your standalone program (e.g....
  • Ken: Hi Han, Thats an interesting idea, one also present in Xcode via the #pragma mark token. There’s a school...
  • Han Geerligs: Hello Ken, how about introducing the “region” concept as used in the Visual Studio...
  • bswang: I use a uitable in guide. The uitable works well on the matlab environment. But when i build the mytest.m...
  • Jennifer French: Hi Stephen, Thanks for posting about dataset. Its great to hear about techniques that work well for...
  • Jennifer French: Hi Quan, Thanks for sharing those techniques for working with excel! They sound quite useful and...
  • Ken: @Steven: Thanks for the great feedback! We’d love to hear more about how you use the dataset function when...
  • Ken: @Quan: xlsread is a great function! Also, I like your cut and paste technique.

These postings are the author's and don't necessarily represent the opinions of The MathWorks.

Related Topics