Matlab and Ubuntu 10.04

Matlab 2009bWhen I started Matlab 2009b on my new install of Ubuntu Lucid Lynx (10.04) I had the problem that some keys weren’t working. Most notably, the [] didn’t work which is quite bad when writing Matlab-code. Also, the terminal outputs this message:

Warning: X does not support locale en_HK.utf8

The problem is that the locale is set to utf8 (small caps) while Matlab requires UTF-8. By specifying the locale before we start Matlab we solve the problem.

Remove the symbolic link to matlab in /usr/local/bin/matlab with

sudo rm /usr/local/bin/matlab

and create a script in its place:

sudo gedit /usr/local/bin/matlab:

and paste this as it’s content:

#!/bin/bash
# Start Matlab with the right encoding
echo “Starting Matlab with en_HK.UTF-8 coding”
LC_CTYPE=”en_HK.UTF-8″ /usr/local/Matlab2009b/bin/matlab

where you change en_HK to something that seems appropriate and is part of the list produced by locale -a. My Matlab is installed in /usr/local/Matlab2009b/.


2 Responses to “Matlab and Ubuntu 10.04”

  1. [...] language (æøå – Norwegian). This is because Matlab does not recognize utf8 in small caps. http://www.anders.bennehag.com/blog/2010/matlab-and-ubuntu-10-04/ Solution LANG=nb_NO.UTF-8 [...]

  2. matlab says:

    great information for us.

Leave a Reply