Psychophysics Toolbox
How to Configure Matlab 6

Introduction
Creating a desktop shortcut to Matlab
Creating a desktop shortcut to the Matlab text editor


The default user interface in the Windows version of Matlab 6 runs within a Java Virtual Machine (JVM). The JVM is incompatible with the Psychtoolbox because it blocks access by Matlab extensions to the Windows event queue. Therefore, to use Matlab 6 with the Psychtoolbox, you must execute Matlab without the JVM. You can do that by using the -nojvm command line option when launching Matlab. Because the "nojvm" version of Matlab 6 lacks a text editor and a file path editor, there are concomitant changes in the way that you edit files and the Matlab path.

The most convenient way to invoke Matlab with the -nojvm command line option is to create on the Windows desktop a shortcut to the Matlab executable, and then to edit that shortcut to add the option '-nojvm'. Detailed instructions for how to do that are here.

The best way to edit .m script files when using the novjm version of Matlab is to launch the Matlab text editor separately from the Matlab command window. The editor executable is named "meditor.exe". The default path to this file is ...\matlabR12\bin\win32\meditor.exe . Detailed instructions for how to create on the desktop a shortcut to meditor.exe are here.

To edit the Matlab file path you must launch the regular version of Matlab, without the -nojvm option. Once you change the path using the regular version of Matlab, and save those changes, then they are retained and used by the -nojvm version of Matlab. Though it is a nuisance to launch the normal version of Matlab just to change the path, I find that I rarely do change the path, so it does not amount to much trouble.


Creating a desktop shortcut to Matlab

1- Locate the Matlab executable on your hard drive. The Matlab 6 installer by default places it in ...\matlabR12\bin\win32\matlab.exe . If it is installed somewhere other, then you can use the Windows Search utility available in the Start menu under Search\For Files or Folders to locate matlab.exe

2- Right-click on matlab.exe and drag it to the Windows desktop. As you drop it on the desktop, a pop-up window will appear. Select "Create Shortcut(s) Here" from that popup menu.

3- Right-click on the newly created shortcut and select "properties" from the pop-up menu which appears. A properties window will appear. Within that window. Click on the "Shortcut" tab. Find the "target" field and append " -nojvm" to the name of the target. For example, my target field reads "C:\matlabR12\bin\win32\matlab.exe -nojvm"

4- Click on the "General" Tab. At the top of the window a field displays the name of the shortcut as it appears on the desktop. Change the name to identify this as the shortcut to the -nojvm version of Matlab. For example, you might change it to "Matlab nojvm" or "Matlab for Psychtoolbox".

5 -Click the "OK" button at the bottom of the properties window to save your changes and close the window.

6- Test the new shortcut by double-clicking on the shortcut icon to launch Matlab.


Creating a desktop shortcut to the Matlab text editor

1- Locate the Matlab editor on your hard drive. The default path to the editor is ..\matlabR12\bin\win32\meditor.exe. If the editor is installed elsewhere on your system, then you can locate it by using the Windows search utility available in the Start menu under Search\For Files or Folders to search for the file meditor.exe.

2- Right-click on meditor.exe and drag it to the Windows desktop. As you drop it on the desktop, a pop-up window will appear. Select "Create Shortcut(s) Here" from that popup menu.

3- Test the new shortcut by double-clicking on the shortcut icon to launch the Matlab editor.



visitors since 28 February 2002.

David Brainard, Denis Pelli & Allen Ingling.
psychtoolbox@yahoogroups.com

28 February 2002