ATTENTION: This toolbox is being deprecated. Please use our new Zaber Motion Library MATLAB toolbox.
In order to use the toolbox, you need to have MATLAB version R2017b or higher installed.
Download the toolbox as a MATLAB Add-On . Double click on the downloaded file to install the add-on. MATLAB should open and indicate "Installation Complete" when it's finished. Alternatively, you can open the file using the Open button from the main menu in MATLAB.
Create a new project in MATLAB:
Create a file named "example.m" (replace example with your desired file name) by selecting Home > New Script to start writing code in MATLAB.
Continue the Getting Started guide by running the example code.
If you are already using the toolbox and want to update to the latest version (9.0.1), return to this page and download a new version using the link above. Before installing the new version, uninstall the old version in Add-Ons > Manage Add-Ons.
MATLAB now supports Apple Silicon, but does not support Java Native Access (JNA) on Apple Silicon. Unfortunately, this toolbox requires JNA to function, so it simply does not work on ARM Macs. We recommend that ARM Mac users switch to using our new MATLAB toolbox. It is also possible to use this toolbox with the Intel macOS version of MATLAB.
This is only an issue for MATLAB versions R2025a or later and is related to how MATLAB handles Java dependencies included in toolboxes.
To verify that this is indeed the problem, run the MATLAB command javaclasspath and check that the output does not contain the path to a file named motion-library-jar-with-dependencies.jar.
If the output does not contain the jar file, add the following function call to a startup.m file in your project or workspace (MATLAB documentation on startup files here):
zaberMotionLibraryInit();
This will make sure that the Zaber Motion Library jar file is on MATLAB's dynamic java path.
If for whatever reason you are using a version of Zaber Motion Library earlier than 7.15.0, then you can include the following in your startup.m file:
jarName = 'motion-library-jar-with-dependencies.jar';
toolboxFolderPath = 'default/add-on/installation/folder';
jarPath = fullfile(toolboxFolderPath, 'Zaber Motion Library (Legacy)', jarName);
if ~any(endsWith(javaclasspath('-dynamic'), jarName)) && ~any(endsWith(javaclasspath('-static'), jarName))
javaaddpath(jarPath);
end
For the location of the Default Add-On Installation Folder, see this page.
If you'd prefer to add the file to the static java class path, you can use MATLAB's javaclasspath.txt file instead (MATLAB documentation).
If the previous version of the add-on was not uninstalled, the new version may not install properly. To fix the issue navigate to Default Add-On Installation Folder (see MATLAB documentation) and delete all folders whose name begin with Zaber Motion Library.
Zaber Motion Library provides functionality to subscribe to events generated by devices. This functionality is, however, disabled for MATLAB as its architecture does not allow spontaneous code execution from system threads.
Setting library logging to standard output results in merging the output into MATLABs process standard output rather than programs Command Window.
We cannot upload the toolbox to MATLAB Central File Exchange because of its policy that a package cannot contain binary files such as DLL.