Matlab Tutorial¶
Contributed by B. Strom.
Note
This was performed on Windows 7 and using MATLAB R2016b (2016b or later is needed for jasondecode()
and jasonencode()
commands)
Install Python¶
- Install Miniconda (Python 3.5 or higher).
- Open a command window as administrator:
- cd to Miniconda3 directory
- run
conda update conda
Install Glyph¶
- If you have git installed, run
pip install –e git+https://github.com/Ambrosys/glyph.git#egg=glyph
. Go to step 5. - Download the latest version from Github.
- Unzip / move to somewhere useful
- Upen a cmd window, navigate the the glyph-master folder
- Run
pip install –e .
(don’t forget the period at the end) - Test the installation by running
glyph-remote --help
.
Install jeroMQ (java implementation of zeroMQ)¶
This will be used for zeroMQ in MATLAB.
- If you don’t have it, install the Java developer kit.
- Set the JAVA_HOME environment variable
- Right click My Computer and select properties
- 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
- Install Maven.
- 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)- Confirm installation with
mvn -v
in a command window
- Download the latest stable release of jeroMQ.
- Unpack the zip file
- In a command window, navigate to the resulting jeroMQ folder
- Run the command
mvn package
- This will take a while, but you should see “Build Success” when it is finished
- 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
- Add the path to this Jar file to MATLAB’s static Java path
- Run the command
prefdir
in MATLAB. Navigate to that folder and check for a file namedjavaclasspath.txt
.- Open this file in a text editor or create anASCII text file named
javaclasspath.txt
.- 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.
- Restart MATLAB
- To test that MATLAB can access jeroMQ, run
import org.zeromq.ZMQ
in at the MATLAB command prompt. If no error, it was successful.