Configuring the Java Socket Environment

Recent versions of MATLAB support the use of Java objects in MATLAB M-scripts, which Isight uses to launch and drive MATLAB using Java sockets. Java Socket is the preferred interface because it is easy to set up, imposes no platform dependencies, and is unaffected by MATLAB upgrades.

Set your MATLAB component preferences to use the Java Socket interface. For more information, see Setting MATLAB Component Preferences.

For the Java Socket interface, you need to specify the location of the MATLAB executable. You can specify the location by defining an environment variable named MATLAB or by defining a Java system property.

You can define an environment variable by editing a Linux logon script or editing a Windows system property. You can omit the MATLAB executable name from the definition of the environment variable. The MATLAB component runtime code appends the name if it is not present. This is done so that current users of the Native Code interface may switch to the Java Socket interface without editing their environment.

If you define a Java system property, the existing value of the environment variable, if any, is overwritten for the current Isight session.

Defining the MATLAB Executable Location with a Logon Script

On Linux systems you can define the environment variable named MATLAB in one of your logon scripts (e.g., .login, .shrc, .profile, or, depending on your preferred shell – .cshrc, etc.). For example, if you use sh (standard shell) on Linux, you may add lines similar to the following to your .shrc script:

MATLAB=/opt/mathworks/matlab_2006b/bin
export MATLAB

Defining the MATLAB Executable Location with a System Property

On Windows systems you can define the environment variable named MATLAB by editing your system properties.

From your desktop, do the following:

  1. Double-click My Computer.
  2. Click View system information.
  3. Click the Advanced tab.
  4. Click Environment Variables.
  5. If only one user can run MATLAB, define the MATLAB environment variable in the User variables section. If more than one user can run MATLAB (e.g., via an Isight station), define MATLAB in the System variables section.
    1. Click New.
    2. Fill in the fields as follows:

      Variable name: MATLAB

      Variable value: c:\software\MATLAB\R2007b\bin\matlab.exe

      Note: If MATLAB is installed on a network drive, you need to enter the path to the MATLAB executable in UNC format (e.g, \\testmachine\MATLAB\R2007b\bin\matlab.exe).

  6. Click OK until you return to your desktop.

Defining the MATLAB Executable Location with a Java System Property

You can define the MATLAB executable location by defining a Java system property named fiper.comp.matlab.command. Do one of the following:

  • If you are running Isight in standalone mode, you can define the Java system property by including the flag definition -Dfiper.comp.matlab.command=<full path to MATLAB> at the command line when you start Isight.

  • System administrators can include the flag definition -Dfiper.comp.matlab.command=<full path to MATLAB> when launching an Isight station from the command line.

  • You can also add the flag definition fiper.comp.matlab.command=<full path to MATLAB> to the station.properties file.