Using MATLAB with Apple's X11 beta

Jan 11, '03 11:27:25AM

Contributed by: JoeHope

MATLAB was ported to OS X as an X-windows application, and is currently only supported with the OroborOSX window manager. X11 is much faster, and it is easy make MATLAB operate with this manager.

First, make a backup copy of the LaunchMATLAB application in the bin/ subdirectory. Then inspect the package contents, and edit Contents -> launch_matlab.sh (TextEdit will do fine). Replace:

if [ "`ps xc | grep OroborOSX`" ]; then
# Bounce less if OroborOSX is already started
sleeptime=30
else
sleeptime=60
fi
# osascript -e 'tell application "OroborOSX" to activate'
osascript Contents/launch_oroborosx
... with ...
if [ "`ps xc | grep X11`" ]; then
sleeptime=20
else
sleeptime=30
fi
osascript Contents/launch_X11
The sleeptime has been reduced because X11 is so much faster :)

Finally, use the Applescript editor to make the run-only file 'launch_X11' (to be also put into Contents/), which simply activates X11. Now MATLAB launches and runs faster, and is more integrated with the rest of the system.

[Editor's note: I don't have MATLAB, so I wasn't able to test this one...]

Comments (13)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20030111082725302