Ken & Mike on 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.

5 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)

  3. Subhankar replied on :

    hi,

    is there any way we can add our customize menu in File menu?

  4. Subhankar replied on :

    hi ,
    is there any way we can add our customize menu under File menu in matlab editor

  5. Mike replied on :

    Subhankar,

    It is not currently possible to customize the MATLAB file menu. Thanks for the suggestion.

Leave a Reply

Wrap code fragments inside <pre> tags, like this:

<pre class="code">
a = magic(3);
sum(a)
</pre>

If you have a "<" character in your code, either follow it with a space or replace it with "&lt;" (including the semicolon).


Ken & Mike work on the MATLAB Desktop team.
  • DP: Hi i have a problem with ezplot3, i want to plot more than i curve in the same graph but hold on command...
  • Ken: Hi Arsalan, Unfortunately there is no way to get the new Editor API in older versions of MATLAB. -Ken
  • Arsalan: Hi, I am very excited about the MATLAB API for editor because right now i am working on a project and i need...
  • Johannes: Since I started using matlab-emacs some days ago I never experienced Emacslink. But I experienced some...
  • Francisco J. Beron-Vera: Hi all, I have recently learned about ViEmu (http://www.vimemu.c om) which, for Vi/Vim...
  • OysterEngineer: When I first learned of the Publish feature in MatLab, I thought it might be useful to help to...
  • Ken: Hi Herve, I’m not quite sure what you mean by “stand-alone&# 8221; mode? -Ken
  • Herve: I wonder when the publish fonction will be supported in standalone mode.
  • Mike: Ravi, What you described should work as far I understand it. Please follow up with technical support. With a...
  • Mike: @Daniel, Thanks for that note.

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