Matlab Tutorial

Contributed by B. Strom.


This was performed on Windows 7 and using MATLAB R2016b (2016b or later is needed for jasondecode() and jasonencode() commands)

Install Python

  1. Install Miniconda (Python 3.5 or higher).
  2. Open a command window as administrator:
  • cd to Miniconda3 directory
  • run conda update conda
  1. Install the numpy and scipy wheels using conda, or download them directly here and here. You can install them with pip install path_to_wheel/wheel_file_name.

Install Glyph

  1. If you have git installed, run pip install –e git+ Go to step 5.
  2. Download the latest version from Github.
  3. Unzip / move to somewhere useful
  4. Upen a cmd window, navigate the the glyph-master folder
  5. Run pip install –e . (don’t forget the period at the end)
  6. Test the installation by running glyph-remote --help.

Install jeroMQ (java implementation of zeroMQ)

This will be used for zeroMQ in MATLAB.

  1. If you don’t have it, install the Java developer kit.
  2. Set the JAVA_HOME environment variable
  1. Right click My Computer and select properties
  2. On the Advanced tab, select Environment Variables, and then edit or create the system variable JAVA_HOME  to point to where the JDK software is located, for example, C:\Program Files\Java\jdk1.8.0_131
  1. Install Maven.
  1. Add the bin directory of the created directory apache-maven-3.5.0 to the PATH environment variable (same steps as the setting the JAVA_HOME variable, but this is a user variable instead of a system variable)
  2. Confirm installation with mvn -v in a command window
  1. Download the latest stable release of jeroMQ.
  1. Unpack the zip file
  2. In a command window, navigate to the resulting jeroMQ folder
  3. Run the command mvn package
  4. This will take a while, but you should see “Build Success” when it is finished
  5. This will have created a “target” directory in the jeroMQ folder. The Jar file we need is in here, something like …/target/jeromq-0.4.1-SNAPSHOT.jar
  1. Add the path to this Jar file to MATLAB’s static Java path
  1. Run the command prefdir in MATLAB. Navigate to that folder and check for a file named javaclasspath.txt.
  2. Open this file in a text editor or create anASCII text file named javaclasspath.txt.
  3. On its own line, add the full path to the jar file, including the file name. You can move it or rename it first if you wish.
  4. Restart MATLAB
  1. To test that MATLAB can access jeroMQ, run import org.zeromq.ZMQ in at the MATLAB command prompt. If no error, it was successful.

Test a basic example