23 February 2011

Simulink on Linux

I was having a problem with simulink under Matlab R2007a. It is fine on windows, but I use Kubuntu Linux and here Matlab crashes and closes with a "segmentation fault" everytime something with concern to simulink gets opened. It happens when I open an existing model, the librabry window or the simulink preferences...


Here's what I did to fix it:

sudo apt-get install sun-java6-jre sun-java6-fonts

then, I opened up the matlab shell script, which is located in:
/{YOUR MATLAB DIRECTORY}/bin/matlab

for me this was /opt/matlab/bin/matlab and I scrolled down to the end of the comments and added this as the very first command in the script:

export MATLAB_JAVA=/usr/lib/jvm/java-6-sun-1.6.0.00/jre/
Other Linux distros may need "setenv" instead of "export"

This points to the location of my Sun JRE 1.6 installation. See this topic if you can't find yours: http://www.mathworks.com/support/solutions/data/1-1812J.html?1-1812J

No comments:

Post a Comment