Last modified 3 years ago Last modified on 2015-12-08 14:33:37

Matlab setup procedure for WHSC sed trans group using SVN at ""

Step 1. Get all the toolkits from the "m_cmg" and "m_contrib" repositories at

  • Windows:
    1. Install TortoiseSVN, then bring up the Windows File Explorer.
    2. Make a new directory called "m_cmg" where you keep your matlab toolkits (mine are in c:/rps, so I made c:/rps/m_cmg).
    3. Make a subdirectory called "trunk" which will contain the main branch of the development tree
    4. Right click on this "trunk" directory (c:/rps/m_cmg/trunk on my system) and if TortoiseSVN installed correctly, you should see an "SVN Checkout" option.
    5. Click on "SVN Checkout" and then type in "" as the URL for the repository
    6. This should download the latest version of the m_cmg toolboxes to your system!
    7. Repeat steps 2-6 to checkout the repository "".
  • Linux:
    1. Use your SVN command line client to checkout m_cmg/trunk and m_contrib/trunk:
      svn co /home/rps/m_cmg/trunk
      svn co /home/rps/m_contrib/trunk 
    2. If you have problems with the command line SVN (e.g. it's not installed on your Linux system or it is not working correctly), try using the SmartSVN Java SVN client. The free version is sufficient.
    3. If using KDESVN (default in Ubuntu), you specify as below:
      svn co /home/rps/m_cmg/
      svn co /home/rps/m_contrib/

No final directory name in the destination- otherwise, you get paths like /home/rps/m_cmg/m_cmg (which you don't really want).

Step 2. Set up Matlab to use the stuff you just downloaded.

  • Set up the Matlab path: Copy the file "m_cmg/trunk/startup_template.m" into Matlab's "toolboxes/local" directory and rename it startup.m. In this way you can have different startup.m files for different versions of matlab.
  • Edit this file to point to the proper m_contrib/trunk and m_cmg/trunk directories on your machine. When Matlab starts, it will automatically run "startup.m", which will then add these directories to your path, so you don't have to mess around with adding to your path via the GUI. Actually it's safer to remove all the local toolbox stuff you added via the GUI and add it to the startup.m file instead. That way you have one place to look to see what's set.
  • Check your Matlab path by typing "path" and make sure it looks ok (without multiple versions of the same toolkit, for example). You may want to remove certain directories via Matlab's "File=>Set Path" GUI that are now being set via startup.m.
  • In Matlab, type "edit classpath.txt" and comment out the line that contains "mwucarunits.jar". This "mwucarunits.jar" file is only used by the Mathworks "Model-Based Calibration Toolbox" and contains an old implementation of the Unidata udunits package that conflicts with the more recent version that NetCDF-Java uses. Restart Matlab.
  • You now should be good to go!

Marinna's startup notes: Marinna's_Matlab_startup