Interfacing ArtiSynth to MATLAB

2 Requirements and configuration

The current version of ArtiSynth has been tested to run with MATLAB 2021a.

To interface with MATLAB, you should run ArtiSynth under Java 8, because that is the Java version currently used by MATLAB. Verify that you do in fact have Java 8 installed, and, if you are using an integrated development environment (IDE), that the IDE is also using Java 8. Details on installing Java 8 can be found in the installation guides for Windows, MacOS, and Linux.

In the following, assume that <ARTISYNTH_HOME> denotes the path to the ArtiSynth installation folder.

  1. 1.

    If you have not done so already, set the environment variable ARTISYNTH_HOME to <ARTISYNTH_HOME>. This can be done externally to MATLAB (see the Section Environment variables in the ArtiSynth Installation Guide for your system), or it can also be done within a MATLAB startup script using the setenv() command; see the MATLAB documentation regarding startup scripts.

  2. 2.

    Make sure that the folder <ARTISYNTH_HOME>/matlab is included in the search path for MATLAB functions; consult MATLAB documentation on how to do this.

  3. 3.

    Ensure that classes required by ArtiSynth are added to the MATLAB Java classpath, as described in Section 7.

  4. 4.

    If you have not done so already, add the ArtiSynth native library folder to the environment variable that specifies the dynamic library search path.

    1. (a)

      On Windows (64 bit), make sure <ARTISYNTH_HOME>\lib\Windows64 is included in the PATH environment variable.

    2. (b)

      On Linux (64 bit), make sure <ARTISYNTH_HOME>/lib/Linux64 is included in the LD_LIBRARY_PATH environment variable.

    3. (c)

      On MacOS, make sure <ARTISYNTH_HOME>/lib/MacOS64 is included in the DYLD_LIBRARY_PATH environment variable.

    For more information on setting these variables, see the Section Environment variables in the ArtiSynth Installation Guide appropriate to your system.

  5. 5.

    Depending on how much memory your ArtiSynth application requires, you may need to adjust the MATLAB Java virtual memory limit (Section 6).

  6. 6.

    As necessary, add the classpath(s) for your ArtiSynth models to the MATLAB Java classpath, so that they will be visible to Java from within MATLAB. See Section 8 for details.