List of possible future posts:

  • The hardcopy function
  • The handle function
  • Interfacing to MS Office and OpenOffice
  • Sending email/SMS (text) messages – the undocumented stuff
  • Command history hacks
  • Editor customizations, projects and services
  • Undocumented MCOS attributes (partially covered)
  • Integrating progress bars within Matlab GUIs
  • Customizing uigetfile/uiputfile
  • YTickLabel alignment
  • Accessing the OpenGL buffer
  • Synth Look & Feel for customizability via XML
  • Swing alternatives to Matlab uicontrols
  • Swing/CSS ideosyncracies
  • Undocumented loadlibrary parameters
  • Database connectivity using JDBC
  • Database connection pooling
  • Accessing SQLite “databases”
  • Formatting dates
  • Interruptible timers
  • Description and analysis of matlab.internal.*
  • Using JADE, JNA, JXLayer
  • Uimode and Mode Managers
  • The JavaFrame container hierarchy
  • Adding MJGrips to figure corners
  • Setting figure window always-on-top and full-screen
  • Using WindowsAPI with Matlab figure windows
  • Mouse cursor customizations
  • Setting axes above uicontrols
  • Debugging Java-Matlab connectivity
  • Undocumented Handle-Graphics properties/features
  • Customizing the Matlab desktop
  • Customizing the shortcuts menus (old Desktop; new toolstrip)
  • Customizing the Variable (Array) Editor
  • Customizing the new ribbon (Toolstrip)
  • Adding toolstrips to figure windows
  • Customizing docking
  • Programmatically hiding and displaying the desktop, editor and relatives
  • Undocumented Mex functions
  • Grandfathered functions
  • Built-in Matlab Java classes and packages
  • Collapsible panels
  • Using JNI to access the Matlab engine
  • JGoodies Forms
  • Customizing uitable
  • JIDE Grids
  • Drag-&-Drop
  • Performance optimizations


  • Setting preferences programmatically
  • Setting system-tray icons and messages
  • Setting and customizing the status bar
  • Complex data structures: hashtables, queues, stacks, deques etc.
  • EDT, or: why does my GUI foul up?!
  • JFreeChart
  • Uitable – the undocumented features
  • Uitree and other tree controls
  • Uitab, uitabgroup and tabdlg
  • Uicontainers and Layout Managers
  • Uiundo
  • UiSplitPane
  • Uicomponent
  • UiInspect
  • FindJObj
  • Undocumented figure-frame customizations
  • Undocumented toolbar functions
  • Customizing menus – the undocumented stuff
  • Context-sensitive help
  • Monitoring memory usage
  • Schema: class, props and relatives
  • Schema.listener and handle.listener
  • Customizing built-in Matlab uicontrols
  • Some Easter eggs…
  • Hidden features of feature()
  • Look-and-Feels
  • Color-selection components
  • Font-selection components
  • Calendar components
  • Spinners and SpinnerDemo
  • Tri-state checkboxes (on,off,partial)
  • Uisplittool and uitogglesplittool
  • Syntax-highlighted labels and editboxes
  • Hyperlinked labels
  • Multi-line labels
  • Multi-column listboxes
  • Adding icons images to menus, popup menus (combo-boxes) and listboxes
  • Animated busy image
  • Customizing the new HG2 graphics

More items will be added as I remember them. Please let me know your thoughts regarding which you would like to see first, or if there are any topics you’d like to see which are not yet on this list.

Yair Altman

48 Responses to TODO

  1. Tom says:

    Hi Yair,

    Please address uitables if you have the time. Specifically, if you can address how to programatically highlight cells from within the gui, that would be *great*…for me at least :)


  2. chris says:

    Hi Yair,

    In March 2009 you posted about “Control over the Plot Window in Java” in Matlab Central. There you described a method how to capture a Matlab figure by re-parenting the Canvas to a Java frame.

    Did you meanwhile get any deeper into this?
    Do you have a solution how to handle resizing, callbacks of the axes and lines, etc.?

    I would really appreciate any help on this!

    Thx, chris

    • @Chris – I haven’t done much work on this since then. Perhaps I will describe this in a future post, but I feel this is a niche topic that would not interest too many people. It would have to wait quite a while before more of the wide-interest topics are covered: tables, trees, controls customization, database connectivity etc. etc.

      If you need more immediate help, please contact me offline, using the email link at the top-right.


  3. Ed Ross says:

    I’m waiting with bated breath for an article related to color-selection components. In particular, I’d like to use the color-selection button that allows selection of a line’s marker color when editing line properties in the figure tools. This particular control allows selection of a color or no color.

  4. Ronald says:


    Great site.

    Anyways, I have been making some graphs and pictures in Matlab, and was just going to make some annotations. Reading the documentation, I came across pinning of annotations to the dataspace of a graph. There is no (documented) way to do this programmatically. Is there a way to do this somehow? I don’t really need this feature for my purposes since the pictures I make are just printed to still images later, its just nice to have. (And if I did want to allow moving of viewpoint, I can always just make some complicated callbacks).

    Anyways, I’d be interested in any post you made that could do this.

  5. Ed Ross says:

    At the risk of appearing greedy, I have another request. I see “Drag & Drop” on your list. I am implementing an ActiveX based solution for dragging files from an external file explorer to a MATLAB figure window but I’d rather use a platform-independent solution (Java?). Much obliged, in advance.

    • Same request for different reasons. We are revamping the SDT GUI and java based drag and drop is on the list. Any input from you (top level drop …) would be very much approciated as the rest of this very useful site.

    • Eric says:

      I am also very interested in a drag & drop Java solution. I had been using one based on richtext.richtextctrl.1 that can be found on the mathworks file exchange, but it never worked on 64-bit operating systems. Now that I am using Windows 7), I am stuck.

    • @Eric – Drag & Drop (DND) is on my TODO list, but I do not believe that I will get around to posting an article about this before the second half of 2012, or maybe even 2013. DND is a complex issue that would be difficult to fit into a blog-type article, requiring quite a bit of effort. There are plenty of other low-lying fruits (so to speak) that I would like to publish before DND.

      In the meantime, you can read section 3.7 of my Matlab-Java programming book, which is dedicated to this topic. If you want a softcopy report about using Java DND in Matlab, please email me and I will send it to you for a small fee.

      If you have a specific issue that cannot wait, I would also be happy to provide you with my consulting services.

    • I recalled seeing this drag&drop request a while ago. I recently posted a Matlab/Java solution on the file exchange to support drag and drop of files and text into Java Swing components. I created it along the way and honestly don’t know exactly what inspired me back then, probably an article of Yair or some other code on the FEX. It might help one to implement drag and drop in a GUI with Java components. For Matlab uicontrols, you could get the underlying Java object using Yair’s findjobj function. You can find it here:

  6. Bogdan says:


    First of all congrats for the site, it contains a lot of useful information. Maybe you can help me out in a problem I have encountered while programming a stand-alone application, which I intend to distribute. I want to replace the standard MatLab icon from the top left corner of each figure/window generated by the application. In most cases i have done it by using this line:

    javaFrame = get(gcf,'JavaFrame');

    But this won’t work with the windows displayed by the uigetfile and menu functions.
    I tried using




    , but all I get are errors. Please help me out here.

    Thanks in advance!

    • @Bogdan – I can’t help you with the uigetfile icon, but I can indeed help with the issue of menu icons:

      I’ve prepared a 10-page report that discusses menu customizations in Matlab, including icons, fonts, colors, tooltips, text-alignment, accelerator (shortcut) keys and callback functions. If you are interested, you can get it here (please allow up to 24 hours for delivery by email).

  7. Hi Yair,

    I just came across a neat undocumented feature during a MATLAB Tour session on MATLAB Coder. The coder command opens up a small GUI that lets you generate .c/.mex/.dll/.exe files from your MATLAB functions.

    The MathWorker who showed it to us explained that coder suffers from the same annoying bug horizon as does C: it only compiles up to the first bug, so you never know how much work you still have to put into the code, and if it’s worth doing so at all.

    The undocumented coder.screener(‘my_function_name’) method does not compile the code, so it can look beyond the horizon, and will give you a report of the code dependencies, split into those that support code generation, and those that do not (the errors).



  8. Tim Kaufmann says:

    Matlab code called from a COM functions IE inside of Excel, Matlab output that would normally be display in the command window if it was not called via a COM function is suppressed. I would like to see if there is a way to enable command window display during a COM function call.



    Your site is very much appreciated.

  9. k. hunter says:

    At work I often have 2-4 matlab sessions open under Linux (one for each programming task).

    However, sometimes one of the sessions crashes and when I restart it, it can’t read the configuration file and opens in the default configuration with no files in the editor. That is a problem as I rely on the editor contents to remember which task I was working on.

    It would be great to have a simple text backup file independent of the history and configuration files which lists which files were loaded by the editor (and maybe which matlab session loaded them). Ideally, this file would update when a new file was loaded to the editor and similarly if it was unloaded.

    One suggestion was to use history. However, I often simply run files from the editor window and so the corresponding command is not in the history file and that would not tell me when the file was loaded (unloaded) beyond the date.

    Any suggestions?

    • @Hunter – Take a look at my EditorMacro utility – it contains code that automatically detects when a new file is opened in the Editor and then does something with it (in that particular case, instruments the new document pane to listen to keyboard keystroke events). You can take that piece of code and adapt it to store the new document’s name in some external log file. Similarly, you can monitor the closing of document windows in the Editor. I’m not saying it’s trivial, but given the basic code in EditorMacro you could have it working within an hour or two.

  10. Robert says:

    For visualization of scientific results (as far as I know, Matlab is intended for this too) it would be quite nice to have correct bilinear value (color) interpolation when drawing quadrilateral (4 node) patches also when the figure is rotated and printed into file. It only works now using default view. Otherwise, symmetrical results do not yield symmetrical plots.

    f = figure;
    s = surf([0 0 0 0 0;
          0 0 0 0 0;
          0 0 1 0 0;
          0 0 0 0 0;
          0 0 0 0 0], ...
    h = surf2patch(s);
    shading interp
    axis image
    shading interp
    axis image
    print -dpng problem
    • @Robert – indeed, Matlab’s built-in print function has many bugs and this is just one of them. Another bug that I constantly run into is printing GUIs that have internal Java components – they look simply awful in the printout.

      My solution is usually not to use print but rather a screenshot of the figure or the requested region. I do this using my ScreenCapture utility, which uses Java’s built-in mechanism for this (see here).

    • Robert says:

      Thank Yair
      Can you also comment on the first part of my message – missing correct bilinear mapping in figures in general (not only printing to file)?
      Do you see any scientific workaround?

    • @Robert – I don’t know. Try asking Customer Server ( – there might even be a documented way to do this.

    • Robert says:

      @Yair Nope, I received information that it cannot be done now but in future version there might be completely new graphical engine. They cannot comment on this issue now and they only redirected me to these pages:

      I wonder if there is a chance to do it now using JAVA directly in Matlab through “import javax.swing.*”? I am not experienced with JAVA yet.

    • Malcolm Lidierth says:

      You might take a look at the SaveAsSVG.m function bundled in the Project Waterloo Swing Library.
      That just uses the Apache Batik Java library (included in MATLAB distributions) to output a MATLAB figure to SVG. It seems to do what you want if I have understood correctly, but to SVG not PNG. Note that MATLAB graphics will be bitmapped, not vectorized, in the SVG

    • @Robert – I must say that I find Mathwork’s official response, directing you to the articles you mentioned above, both flattering and ironic.

      Keep in mind that Mathworks does not endorse any of the articles or information on this website. Also, none of my information comes from official Mathworks sources (excluding what I find in the source files of course). I have made mistakes in the past, and I will probably make more mistakes in the future, and without official Mathworks feedback I will not even know that I have made some mistakes. So, everything that I report (especially about my hunches of future plans, as for HG2), should be taken with caution and skepticism.

    • Cuciuc says:

      Introduction to Matlab intended for beginners. The first part of the video can be obtained here. It comes from a course I teach as part of an online Masters degree program in engineering

  11. Stephan says:

    Hi Yair,

    what a great site – thanks!

    I wondered whether you know of a solution concerning color mapping of images: When using ‘imagesc’, the data is mapped LINEARLY to the colors of the colormap. Is there a way to change the mapping function to e.g. a logarithmic one?
    (I mean, as a workaround one could modify the data and then also modify the tick labels on the colorbar accordingly… but changing the mapping function would be much more elegant.)


    • @Stephan – you could hack imagesc and its relatives to achieve what you want, but IMHO modifying the colormap and then the colorbar would be more maintainable, not more difficult and not less elegant compared to hacking the built-in functions. You might consider wrapping up the code in a small utility – I think it could be a useful addition to the File Exchange (take a look around over there – maybe somebody has already thought of this and implemented it). If you decide to implement this utility, I suggest to have as one of its input args a parameter that accepts a function handle or function name – this way users could pass not only the @log (or ‘log’) function but also other functions (hmmm – how about @sin ???)

  12. Ofer says:

    Hi Yair,

    Thanks for all the interesting and useful functions and examples.

    I have a question regarding communicating over Telnet:
    I need to connect to a telnet server and send/recieve some characters (not very rapidly).
    What is the best way to do it?

    Thanks in advance,

  13. Michele Squillante says:

    Dear Yair,

    thank you very much for your great work, it proved helpul for me countless times.

    I’m looking into some way to override the Ctrl+C behaviour to prevent it from crashing my (compiled) GUI when no edit box or similar has focus; did you ever look into this before?


  14. Sergio Zlotnik says:

    Hi Yair,
    do you have any clue about why the ezplot* functions, used under the symbolic toolbox, do not return a handler to the plotted object?

    • @Sergio – I do not know. Try to edit these files (they are probably simple m-files that you can edit in the Matlab editor) and find out. Don’t be afraid to modify these functions to return the handles that you need.

  15. Charlie says:

    Hi Yair! Excellent blog!

    It’d be great if you could talk about Matlab’s serial object and its tricks.


  16. Michele says:


    what about (automatic) uml (sequence and class) diagram generator?


    • @Michele – I do not have any plans to discuss these issues: I am not aware of any undocumented (nor documented) feature or tool that supports this.

  17. Matt says:


    I’m very much looking forward to the new ribbon miniseries! There’s some information out there on customizing them, but your contributions often make working with the hidden aspects of Matlab so much easier.

  18. Erik says:

    Please document the system_dependent function (e.g. see its uses in ver.m). It can get OS specific info, which can be of major use for GUI developers that need to customise their GUIs based on the system OS version, not only on the OS being Windows, Linux or Mac OS X.

  19. Herbert says:

    Hi Yair,

    if possible, please document some possibilities of measuring MATLAB’s overall RAM usage on Linux (not on a per-line or per-function basis). I thought it might be possible to use some information from the underlying JAVA or Linux’s PROCFS. For the first option, I’m lacking a lot of background information how MATAB uses JAVA and how it allocates memory.

    Thanks a lot for consideration.

    • @Herbert – For this kind of information you want to have a look at /proc/self/status. You can replace self with any process ID, but self always automatically resolves to the process that is requesting the information, thus if you read this from within MATLAB with fileread('/proc/self/status'), you’ll get information on the currently running MATLAB process.

      The two most interesting fields in this file are VmRSS (RSS = resident set size) which is roughly the currently occupied RAM and VmHWM (HWM = high water mark) which is the peak RAM usage during the lifetime of the process. Some documentation on this file and related files can be found via man 5 proc. If you happen to work on NUMA machine (typically multiple nodes with distinct memory interfaces) then you can inspect /proc/self/numa_maps to get a detailed overview of all memory belonging to the process and how it is distributed across the nodes in the machine. (And man 5 numa provides more detail on how to interpret this file.)

      I hope this helps to get you started.

  20. Darin says:

    Are you planning to do Graph / Digraph?

  21. Victor says:

    Hi Yair,

    is it possible to call JavaFx from Matlab and use it for GUI/graphics?

    Thanks and D”Sh from Germany

    • @Victor, yes, you can embed JavaFX in a swing JFXPanel (which you can insert into any Matlab GUI container, e.g. figure/tab/panel), and then modify the contents there. See Malcolm Lidierth’s comment here:

    • D Brien says:

      I am experimenting with this now. You need to change your java version to 1.8+, which requires setting the environment variable. It doesn’t appear that this breaks anything as far as I’ve seen, but officially even MATLAB 2017a still is on 1.7, which is too bad. You will also need to set up your static classpath to include the jfxrt.jar and any custom functions you will end up using.

      From there a JFXPanel will initialize the JavaFX toolkit and you can add a scene and all of the JavaFx functions work fine. You will need to use Yair’s method for sending event notices if you wish to communicate with MATLAB. This is nice though because you can actually use css to skin the look of the GUI. It seems like possible the best option for creating fully customizable GUIs in MATLAB.

      The set up is the biggest pain I’ve found is the set up and changing the native java version. Not all clients will want to do that.

    • Try it in R2017b :-)

Leave a Reply

Your email address will not be published. Required fields are marked *