Configuring the Native Code Environment

All MATLAB versions include a set of native-code libraries implementing an API through which an application can launch and drive MATLAB. The MATLAB component includes a native-code interface that uses this API. Prior to the introduction of Java into MATLAB, Native Code was the only supported interface; and it is still supported for backward compatibility. If you have been using this interface and you upgrade to a later MATLAB version, you can continue using this interface as long as you can link it to the MATLAB shared libraries.

For the Native Code interface, two pieces of information are needed:

  • the location of the MATLAB executable, and

  • the location of the MATLAB native-code API shared libraries.

You can specify the above locations by defining two environment variables named MATLAB and MATLAB_SHLIB, respectively.

You can define the environment variables by editing a Linux logon script, editing a Windows system property, or by entering a command on the command line.

If you define the environment variable from the command line, the existing value of the environment variable, if any, is overwritten for the current Isight session.

On Windows systems, you must include the platform subdirectory (e.g., win32) in the definition of the environment variable MATLAB, and you must register MATLAB from that subdirectory. See Registering MATLAB for details.

Defining the MATLAB Executable and Native-Code API Locations with a Logon Script

On Linux systems you can define two environment variables named MATLAB and MATLAB_SHLIB 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

MATLAB_SHLIB=/opt/mathworks/matlab_2006b/bin/glnx86               
export MATLAB_SHLIB

When you start Isight, the MATLAB value is added to the PATH variable setting and the MATLAB_SHLIB value is added to the library path variable setting (LD_LIBRARY_PATH, SHLIB_PATH, or LIBPATH, according to the platform).

Defining the MATLAB Executable and Native-Code API Locations with a System Property

On Windows systems you can define two environment variables named MATLAB and MATLAB_SHLIB by editing your system properties.

When you start Isight, the MATLAB and MATLAB_SHLIB values are added to the PATH variable setting. This configuration requires that you install MATLAB on the same machine that runs Isight. The Windows version of the Native Code interface cannot run an instance of MATLAB installed on another machine (even if the machine is on a shared network drive). For information about registering MATLAB, see Registering MATLAB.

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

      Variable name: MATLAB_SHLIB

      Variable value: c:\software\MATLAB\R2007b\bin\win32

  6. Click OK until you return to your desktop.

Defining the MATLAB Executable and Native-Code API Locations from a Command Line

You can define the environment variables named MATLAB and MATLAB_SHLIB from the command line before launching Isight in standalone mode. This is useful if the environment variable has not already been defined or if you want to override the defined environment variable (e.g., to use another version of MATLAB).