Share via


Downloading and Installing MATLAB

Kinect for Windows 1.7, 1.8

MATLAB is a high-level language and interactive environment for numerical computation, visualization, and programming. This overview explains how to download and integrate MATLAB in preparation for using the Kinect for Windows SDK KinectBridgeWithMATLABBasics D2D C++ Sample

Prerequisites

  • You must have Visual Studio 2010 or Visual Studio 2012 installed. Express, Professional, Premium, or Ultimate versions can be used.
  • You must install the Kinect for Windows SDK, which is a free download.

Step 1: Installation

  1. Download and install either the 32-bit or 64-bit edition of MATLAB from the Mathworks website.

Step 2: Set the system environment variables

There are two ways to set the system environment variables: using the provided environment variable script or setting the environment variables manually.

Automatic Method

A script called KinectBridgeWithMATLABBasics-D2DEnvironmentSetup.bat is provided. This script will set the appropriate system environment variables, with the exception of the PATH variable, for you.

The script can be run as follows:

  KinectBridgeWithMATLABBasics-D2DEnvironmentSetup.bat [ MATLAB_Directory ]
      

Specify the location of the MATLAB installation in MATLAB_Directory. If the location is left blank, the script will attempt to automatically detect it. If that fails, the script will prompt the user for the location.

Manual Method

  1. Open the Start Menu. Right-click Computer, then select Properties. Click Advanced system settings and then click Environment Variables.

  2. In the System variables section, click the New button. For Variable name, enter MATLAB_DIR. For Variable value, enter the location of the MATLAB installation.

  3. This step is optional. The KinectBridgeWithMATLABBasics-D2D Visual Studio project is set up to modify the path automatically when the sample is run from within Visual Studio. If you want to run this sample outside of Visual Studio, then this step is necessary.

    Find and double-click the Path system variable. In the Variable value field of the dialog box, add one of the following:

64-bit path: %MATLAB_DIR%\bin\win64 32-bit path: %MATLAB_DIR%\bin\win32

If you ever change your installation directory or download a new version of MATLAB, change the environment variables to the correct new values.

Note that modifications to the environment variables do not result in immediate change. For example, if you start another Command Prompt after making the changes, the environment variables will reflect the previous (not the current) values. You must restart Visual Studio once you make modifications to the environment variables. The changes do not take effect until you log off and then log back on.