Undocumented Matlab
  • SERVICES
    • Consulting
    • Development
    • Training
    • Gallery
    • Testimonials
  • PRODUCTS
    • IQML: IQFeed-Matlab connector
    • IB-Matlab: InteractiveBrokers-Matlab connector
    • EODML: EODHistoricalData-Matlab connector
    • Webinars
  • BOOKS
    • Secrets of MATLAB-Java Programming
    • Accelerating MATLAB Performance
    • MATLAB Succinctly
  • ARTICLES
  • ABOUT
    • Policies
  • CONTACT
  • SERVICES
    • Consulting
    • Development
    • Training
    • Gallery
    • Testimonials
  • PRODUCTS
    • IQML: IQFeed-Matlab connector
    • IB-Matlab: InteractiveBrokers-Matlab connector
    • EODML: EODHistoricalData-Matlab connector
    • Webinars
  • BOOKS
    • Secrets of MATLAB-Java Programming
    • Accelerating MATLAB Performance
    • MATLAB Succinctly
  • ARTICLES
  • ABOUT
    • Policies
  • CONTACT

Matlab installation woes

September 2, 2011 9 Comments

With Matlab’s latest release yesterday (R2011b, a.k.a. 7.13), once again I came across a few undocumented hickups. I have a plain-ol’ Win XP machine and hate to think what users of Macs/Linux (esp. Ubunto) need to go through in each installation. Perhaps the items below might alleviate some of the pain.
Note that on your system you may be unaffected by some or all of the issues below. All these issues have occurred for the past several Matlab installations, and are NOT unique to the new R2001b:

Bootstrap loader

Matlab uses a simple download_agent.jnlp file as its installer bootstrap loader. This is a very small (2KB) XML file that tells your Operating System’s Java runtime engine, which automatically runs JNLP files, which JAR files to download (yes, the basic loader is Java-based).
The hickup I encounter four times a year (two pre-releases and two production releases) is that at least on my system, FireFox downloads the file not as download_agent.jnlp but as download_agent. I cannot then run this file, since it has no file extension. Adding the .jnlp extension manually solves this issue.

Installer

Double-clicking the JNLP file then runs the JNLP using the OS’s JRE. After downloading the specified JARs, com.mathworks.agent.AgentGUI is invoked with a specified URL of another XML file. This second XML file actually contains the list of installer application file URL and some zip files that contain the actually installable files.
The hickup here is that the installer automatically downloads dozens of MB of Japanese-related materials (documentation, translation files etc.) that are irrelevant to me (as well as for most Matlab users). I have nothing against Japanese in general, I just hate my time, bandwidth and disk space being wasted in vain. I can’t do much regarding the first two, but at least I can delete the Japanese installer files after they have been downloaded: install_guide_ja_JP.pdf, archives/MATLAB713_doc_ja.zip, help/ja_JP etc.

Pre-release

Matlab’s installer is smart enough to automatically detect an existing pre-release installation of Matlab, and polite enough to ask me whether to overwrite that location or to install Matlab into a new folder. I often choose the later since I make changes to system files and I do not want them to be overwritten automatically. Unfortunately, the Matlab installer may be too smart: It installs Matlab onto the new folder but prevents running the old pre-release in parallel. In effect, it uninstalled my pre-release without physically removing the files. So while I can still see my modified files in the pre-release folders, I can no longer see them in action. This is a real shame.
A more pressing problem is that the new installation keeps the old Matlab path (which points to the pre-release folders), rather than to the new production folders. This can easily be fixed using pathtool or the main menu’s File / Set path…, but I am guessing that most users would not have easily noticed this issue.

Java

Matlab’s installer copies many user-generated preference files, but unfortunately not some files that are critical to using Java in Matlab, namely librarypath.txt and classpath.txt. I needed to manually copy my changes from the previous version onto the new version’s files.
You could say that this proves (yet again) the need to place librarypath.txt and classpath.txt in a user folder rather than modifying the system files. However, in some cases, particularly when, as in my case, there are numerous start-up folders for different projects, it is often easier and simpler to modify the central system files rather than using and maintaining numerous user copies.
A related issue is the installer’s failure to generate (and copy the contents) of the %matlabroot%/java/patch folder. This is a very important folder for java users in Matlab, since it is automatically included in Matlab’s static classpath (the aforementioned classpath.txt) and any class file placed in this folder will therefore be automatically recognized and available in all Matlab sessions without the need for calling javaaddpath (which has some serious drawbacks). I have a set of Java classes that I always use and the path folder is the perfect place for them. I just need to remember to copy this folder after each installation…
These minor woes behind us, we can start enjoying the new Matlab release. Here’s a candy from the new version: It is a built-in demo of what may be Matlab’s upcoming GUI capabilities, in this case a Toolstrip. I will explore it in detail in some later post:

>> com.mathworks.xwidgets.desktopexamples.ToolstripShowCase.main('')

>> com.mathworks.xwidgets.desktopexamples.ToolstripShowCase.main('')

Matlab's new Toolstrip (click to zoom)
Matlab's new Toolstrip (click to zoom)

Related posts:

  1. Matlab installation take 2 – A list of suggested config changes to the default Matlab installation is detailed. ...
  2. Matlab toolstrip – part 9 (popup figures) – Custom popup figures can be attached to Matlab GUI toolstrip controls. ...
  3. Matlab toolstrip – part 2 (ToolGroup App) – Matlab users can create custom Apps with toolstrips and docked figures. ...
  4. JSON-Matlab integration – JSON can easily be integrated in Matlab to achieve cross-platform standard API. ...
  5. Types of undocumented Matlab aspects – This article lists the different types of undocumented/unsupported/hidden aspects in Matlab...
  6. Sending HTML emails from Matlab – Matlab's sendmail only sends simple text messages by default; a simple hack can cause it to send HTML-formatted messages. ...
Installer Java Pure Matlab Toolstrip Undocumented feature
Print Print
« Previous
Next »
9 Responses
  1. Alexander Kosenkov September 2, 2011 at 12:33 Reply

    Thank you for sharing your experience!

    Just in case you missed it:

    % similar to your findjobj.m
    com.mathworks.xwidgets.desktopexamples.UIExplorerDesktop.main(''); 
     
    % amazing! just amazing
    com.mathworks.xwidgets.desktopexamples.EventViewer.main('');
     
    com.mathworks.xwidgets.desktopexamples.SystemPropertyViewer.main('');
     
    % I would love to have such UI control
    com.mathworks.xwidgets.treetableexample.TreeTableExample;

    % similar to your findjobj.m com.mathworks.xwidgets.desktopexamples.UIExplorerDesktop.main(''); % amazing! just amazing com.mathworks.xwidgets.desktopexamples.EventViewer.main(''); com.mathworks.xwidgets.desktopexamples.SystemPropertyViewer.main(''); % I would love to have such UI control com.mathworks.xwidgets.treetableexample.TreeTableExample;

    (run line-by-line; beware, closing some of those windows shuts Matlab down)

  2. Donn Shull September 5, 2011 at 12:26 Reply

    One undocumented tip for people who are not afraid of changing things in the MATLAB installation directories is to create *.phl files for your MATLAB path additions. When you install a new version of MATLAB copy these phl files to $matlabroot$/toolbox/local/path. Then issue the MATLAB command restoredefaultpath followed by savepath and your additions will be included in the path. There is phl file for every toolbox you have installed to use as examples.

  3. James Myatt September 6, 2011 at 03:18 Reply

    For what it’s worth, I have no trouble with the bootstrap loader in Chrome. I think it’s more of a Firefox issue.

  4. Helge September 7, 2011 at 10:21 Reply

    Thanks again for checking/reporting the tweaks and fixes we need to get our Matlab running as we expect it to do.
    This inspired me to share some rather general comments:

    For people who need to update or reinstall Matlab frequently, it may be useful to create their own “checkinstall.m” script. Some of my toolboxes have such a checkinstall.m, mainly to check/fix missing or interfering path extensions, pathdef, classpath etc in case that the toolbox needs M-files, MEX-files or libraries elsewhere on the path, but also to setup/clear persistent and global variables and doing some set(0,’Default…’,stuff). However, I did not yet need a global checkinstall.m for Matlab itself, and I did never go so far and copy/move/delete or dynamically rewrite critical files on hard disk automatically (see, e.g., savepath.m, update_toolbox_cache.m). Since my checkinstall.m files are all highly project-specific, it would not make much sense to upload them anywhere. The point I want to make here is:

    It can save lots of future work to copy+paste some code from matlabrc.m, hgrc.m, pathdef.m, classpath.txt and others, learn about the ressources used there, and remix all this to create your own checkinstall.m, init.m, startuser.m or whatever you may call it. Of course, one can also edit any toolbox/local/*.* file directly, at least if it does not make one mad to fix a dozen of core Matlab files manually twice a year, always taking care that nothing important gets lost. Hence, I would always try to fix setup issues by user/project specific path automation scripts which are executed only on demand.
    Neverthesess, I always found it quite conclusive to load the matlabrc.m and alike functions into an editor and compare them with older versions. Changes in these functions may reveal more about new features than one would find in the official Matlab release notes.

    Of course, the above recommendations are clearly a matter of personal taste, and some issues are definitely awkward to solve by purely project/toolbox specific scripting. But finally, although a manually or automatically patched Matlab installation may be much more convenient and performant on the programmer’s single-user machine, one should never forget that such tweaks can easily turn into severe flaws: (1) My M-code may possibly not run as intended on other systems; and I suppose most customers won’t like me to tell them that something is wrong with their Matlab/Java. (2) After pimping my Matlab, how could I even test whether my code is still suitable for other users?

    I hope I made clear that I do not citicize but rather appreciate anybody who thoroughly investigates and understands post-installation issues, specifically those who know where fixes are mandatory, optional, or even dangerous. However, take care!

  5. Michelle Hirsch September 8, 2011 at 10:24 Reply

    Yair – sorry for the grief you’ve had getting 11b up and running on your machine. I’ve poked around a bit, and can comment on a few of the issues you’ve mentioned:

    Bootstrap loader: we’ve seen this issue occasionally, too. We’ve made sure that the development team knows that it’s still happening.

    Installing Japanese doc: We are aware that this is unnecessary and hope to be able to address it to reduce download sizes/times for our users.

    Running prerelease after installing general release: I’m not sure what issues you are finding here. Our installer doesn’t touch the existing prerelease installation when installing the general release. We do point the operating system to the latest release, so that shortcuts, add/remove programs, etc. find the latest release. You should be able to run the prerelease by running MATLAB.exe directly from the bin dir (or making a new shortcut to it).

    path: I’m a bit puzzled about your path issue, too. We don’t migrate path from release to release (this is actually something I’d like to see changed), so the only way I see this happening is if you have your new MATLAB intentionally pointing to your old pathdef.m. The default locations for pathdef.m are in release-specific folders. I’m sure I’m missing something, so please clarify if I am.

    • Yair Altman September 9, 2011 at 08:40 Reply

      @Michelle – Thanks for your follow-up. The items I listed above are a minor inconvenience rather than cause of actual grief… Perhaps the term “woes” in the title was an exaggeration. On the other hand, I rarely have a chance to use this term in day-to-day, and it had a nice ring to it, and article titles do need to attract the eye…

      Anyway, running the pre-release exe directly from its bin folder doesn’t work. It’s the first thing I tried upon discovering that all my old Start-menu shortcuts have been deleted by the new R2011b installation. When you run the pre-release exe it simply launches the the new R2011b executable. I’m guessing that some important Windows registry key has been overwritten by the new installer. The bottom line is that while the PR is still “installed” on my computer, it cannot in fact be run. This is a moot point now, as the PR expiration date has now passed, but I think it should be investigated to determine whether there is any bug in there that could have a wider effect. For example, what happens when we get a service-pack release as last year? – will the original (“SP0”) not be accessible any longer? If so, this could be troublesome. Let the user decide if they want to overwrite the existing version or not. Matlab users are smart enough to design rockets and cars, surely they can manage this decision.

      Path – I am not sure why this happened. Perhaps because of the pre-release vs. Prod versions mixup that caused the previous issue.

  6. Matlab installation take 2 | Undocumented Matlab September 12, 2012 at 06:08 Reply

    […] I won’t bother repeating the list that I published here exactly one year ago […]

  7. Valeria May 9, 2013 at 04:01 Reply

    Thank you very much for posting this, am an elccarietl engineering student too n this solves just 1 of my problems. Before i applied this neat trick, matlab 7 wasn’t even opening on my manchine, now it opens n i get to see it briefly about 2 seconds then it closes itself. Am on an X64 AMD machine n i think that is the problem. Could you know of a work around to this? I’ll appreciate any help

    • Yair Altman May 15, 2013 at 10:43 Reply

      @Valeria – there is no “silver bullet” for this problem. It could be due to many different reasons. I suggest that you contact support@mathworks.com

Leave a Reply
HTML tags such as <b> or <i> are accepted.
Wrap code fragments inside <pre lang="matlab"> tags, like this:
<pre lang="matlab">
a = magic(3);
disp(sum(a))
</pre>
I reserve the right to edit/delete comments (read the site policies).
Not all comments will be answered. You can always email me (altmany at gmail) for private consulting.

Click here to cancel reply.

Useful links
  •  Email Yair Altman
  •  Subscribe to new posts (feed)
  •  Subscribe to new posts (reader)
  •  Subscribe to comments (feed)
 
Accelerating MATLAB Performance book
Recent Posts

Speeding-up builtin Matlab functions – part 3

Improving graphics interactivity

Interesting Matlab puzzle – analysis

Interesting Matlab puzzle

Undocumented plot marker types

Matlab toolstrip – part 9 (popup figures)

Matlab toolstrip – part 8 (galleries)

Matlab toolstrip – part 7 (selection controls)

Matlab toolstrip – part 6 (complex controls)

Matlab toolstrip – part 5 (icons)

Matlab toolstrip – part 4 (control customization)

Reverting axes controls in figure toolbar

Matlab toolstrip – part 3 (basic customization)

Matlab toolstrip – part 2 (ToolGroup App)

Matlab toolstrip – part 1

Categories
  • Desktop (45)
  • Figure window (59)
  • Guest bloggers (65)
  • GUI (165)
  • Handle graphics (84)
  • Hidden property (42)
  • Icons (15)
  • Java (174)
  • Listeners (22)
  • Memory (16)
  • Mex (13)
  • Presumed future risk (394)
    • High risk of breaking in future versions (100)
    • Low risk of breaking in future versions (160)
    • Medium risk of breaking in future versions (136)
  • Public presentation (6)
  • Semi-documented feature (10)
  • Semi-documented function (35)
  • Stock Matlab function (140)
  • Toolbox (10)
  • UI controls (52)
  • Uncategorized (13)
  • Undocumented feature (217)
  • Undocumented function (37)
Tags
ActiveX (6) AppDesigner (9) Callbacks (31) Compiler (10) Desktop (38) Donn Shull (10) Editor (8) Figure (19) FindJObj (27) GUI (141) GUIDE (8) Handle graphics (78) HG2 (34) Hidden property (51) HTML (26) Icons (9) Internal component (39) Java (178) JavaFrame (20) JIDE (19) JMI (8) Listener (17) Malcolm Lidierth (8) MCOS (11) Memory (13) Menubar (9) Mex (14) Optical illusion (11) Performance (78) Profiler (9) Pure Matlab (187) schema (7) schema.class (8) schema.prop (18) Semi-documented feature (6) Semi-documented function (33) Toolbar (14) Toolstrip (13) uicontrol (37) uifigure (8) UIInspect (12) uitools (20) Undocumented feature (187) Undocumented function (37) Undocumented property (20)
Recent Comments
  • Nicholas (3 days 22 hours ago): Hi Yair, Thanks for the reply. I am on Windows 10. I also forgot to mention that this all works wonderfully out of the editor. It only fails once compiled. So, yes, I have tried a...
  • Nicholas (3 days 22 hours ago): Hi Yair, Thanks for the reply. I am on Windows 10. I also forgot to mention that this all works wonderfully out of the editor. It only fails once compiled. So, yes, I have tried a...
  • Yair Altman (4 days 5 hours ago): Nicholas – yes, I used it in a compiled Windows app using R2022b (no update). You didn’t specify the Matlab code location that threw the error so I can’t help...
  • Nicholas (5 days 1 hour ago): Hi Yair, Have you attempted your displayWebPage utility (or the LightweightHelpPanel in general) within a compiled application? It appears to fail in apps derived from both R2022b...
  • João Neves (8 days 6 hours ago): I am on matlab 2021a, this still works: url = struct(struct(struct(struct(hF ig).Controller).PlatformHost). CEF).URL; but the html document is empty. Is there still a way to do...
  • Yair Altman (11 days 5 hours ago): Perhaps the class() function could assist you. Or maybe just wrap different access methods in a try-catch so that if one method fails you could access the data using another...
  • Jeroen Boschma (11 days 7 hours ago): Never mind, the new UI components have an HTML panel available. Works for me…
  • Alexandre (11 days 8 hours ago): Hi, Is there a way to test if data dictionnatry entry are signal, simulink parameters, variables … I need to access their value, but the access method depends on the data...
  • Nicholas (11 days 23 hours ago): In case anyone is looking for more info on the toolbar: I ran into some problems creating a toolbar with the lightweight panel. Previously, the Browser Panel had an addToolbar...
  • Jeroen Boschma (15 days 6 hours ago): I do not seem to get the scrollbars (horizontal…) working in Matlab 2020b. Snippets of init-code (all based on Yair’s snippets on this site) handles.text_explorer...
  • Yair Altman (43 days 8 hours ago): m_map is a mapping tool, not even created by MathWorks and not part of the basic Matlab system. I have no idea why you think that the customizations to the builtin bar function...
  • chengji chen (43 days 14 hours ago): Hi, I have tried the method, but it didn’t work. I plot figure by m_map toolbox, the xticklabel will add to the yticklabel at the left-down corner, so I want to move down...
  • Yair Altman (51 days 7 hours ago): @Alexander – this is correct. Matlab stopped including sqlite4java in R2021b (it was still included in 21a). You can download the open-source sqlite4java project from...
  • Alexander Eder (57 days 3 hours ago): Unfortunately Matlab stopped shipping sqlite4java starting with R2021(b?)
  • K (63 days 13 hours ago): Is there a way to programmatically manage which figure gets placed where? Let’s say I have 5 figures docked, and I split it into 2 x 1, I want to place 3 specific figures on the...
Contact us
Captcha image for Custom Contact Forms plugin. You must type the numbers shown in the image
Undocumented Matlab © 2009 - Yair Altman
This website and Octahedron Ltd. are not affiliated with The MathWorks Inc.; MATLAB® is a registered trademark of The MathWorks Inc.
Scroll to top