MATLAB

Why a new MATLAB Toolbox?

The original Zaber Motion Library MATLAB toolbox (MATLAB legacy) is a bundled Java library which takes advantage of the fact that MATLAB can call into Java code. After releasing it for many years, we deemed that the MATLAB-Java user experience just wasn't up to our standards. So, we decided to create a dedicated MATLAB toolbox which takes advantage of MATLAB language features, such as argument validation, name-value arguments, typed return values and MATLAB class properties. This toolbox also supports events, something that we were unable to do in the legacy version.

While both the new and legacy toolboxes provide much of the same functionality, the aim is that this one will provide a better development experience, with smarter, more comprehensive autocomplete suggestions and a more intuitive API overall.

Getting Started

In order to use the toolbox, you need to have MATLAB version R2022b 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. If double-clicking the file does not work, you can drag and drop the toolbox package file into your open MATLAB window. Alternatively, you can open the file using the Open button from the main menu in MATLAB.

Create a new project in MATLAB:

  • In the Home tab, click New > Project > Blank Project.
  • When the New Project dialog opens, enter a project name and select a folder (or create a new folder for the project), then click Create.

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.

Updating

If you are already using the toolbox and want to update to the latest version (9.1.0), 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.

Migrating from Legacy Toolbox

If you are migrating a project from the legacy Zaber Motion Library toolbox to this one, please view our migration how-to guide.

Known issues

Library does not work after first reopen

MATLAB will not update its add-on cache until it has been closed twice. This means that you need to reopen MATLAB twice after the first time you install this toolbox in order for everything to work correctly. The first time you reopen, the toolbox folders will not be added to your MATLAB path. MathWorks is aware of this problem.

Update does not work

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.

Logging

Setting Zaber Motion Library logging to standard output results in merging the output into MATLABs process standard output rather than programs Command Window.

File Exchange

We cannot upload the toolbox to MATLAB Central File Exchange because of its policy that a package cannot contain binary files such as DLLs.