Setting up your MATLAB environment

If you are going to use the MATLAB/Java interface, one additional configuration step is required: you must add the NDS client to MATLAB's Java classpath. You can either modify the 'dynamic classpath' for your current MATLAB session, or permanently add NDS to MATLAB's classpath.

Adding NDS to the classpath for the current MATLAB session

You can modify the 'dynamic classpath' for the current MATLAB session by using the MATLAB command javaaddpath, like this:

>> javaaddpath /path/to/local/share/java/nds2/nds2.jar


For example: if you are on a Mac and you installed from MacPorts, the appropriate path is:
>> javaaddpath /opt/local/share/java/nds2/nds2.jar

Permanently adding NDS to the classpath

Alternatively, you can permanently add NDS to the MATLAB classpath by editing the MATLAB configuration file classpath.txt. Inside MATLAB, open this file by issuing the edit command:

>> edit classpath.txt

This command opens classpath.txt in an editor. Scroll to the end of the file, which might look something like this:

# Java classpath entries for webintegration
# Java classpath entries for ws_clients

Add the following line:


Finally, save classpath.txt and restart MATLAB.

Note on java paths, jar files versus loose classes

In previous versions the java class path was configured to point to a library directory and not to a specific file. This is a change implemented starting in NDS client 0.13.0. For the first few 0.13.x releases both the old method of referring to a directory and the new of refering to a specific file will be made available. However going forward users should configure their MATLAB installs by directly referencing the nds2.jar file.

Some explaination for the changs. The MATLAB NDS client is implemented in the java programming language. Java packages are typically distributed in .jar files (Java ARchives). In the past the java/MATLAB bindings had distributed the NDS client as a loose set of java '.class' files. This is changing to bring the NDS bindings more in line with how Java is typically used. To help users during a transition period the NDS client will be distributed with both the '.jar' file and the loose java '.class' files for the next few releases. However the end state will involve distributing only the '.jar' files.