Installation

A single API is provided for MATLAB and GNU Octave, but must be installed differently.

Follow the instructions below for your platform.

MATLAB

Optional: Pulse Pal now supports the low-latency PsychToolbox 3 Serial Interface (IOPort) in MATLAB. If it is detected, Pulse Pal will use it by default. To use the interface, follow the directions HERE to install PsychToolbox.

The MATLAB client files are in the /PulsePal/MATLAB folder - but MATLAB does not know that this folder exists.

1. Open MATLAB (in Windows, right-click the MATLAB icon and select "run as administrator".

In Linux, make sure you have super-user permissions: from the terminal, sudo ./MATLAB)

2. In r2012a or later, choose "Set Path" from the "Environment" cluster in the "Home" tab.

In r2011b or earlier, choose "File > Set path".

3. Choose "Add Folder".

4. Select /PulsePal/MATLAB/ and click "Add".

5. Click "Save" at the bottom so MATLAB will know where Pulse Pal is for all future sessions.

6. To verify that you were successful, make sure Pulse Pal is plugged in and type PulsePal at the MATLAB command prompt*

*On Windows XP, type PulsePal('ComPort') where 'ComPort' is the Pulse Pal serial port. For Pulse Pal 1, this will appear as a "Leaflabs Maple" serial port in the Windows device manager. For Pulse Pal 2, it will appear as "Arduino Due".

If all went well, Pulse Pal will connect.

If you see an error that says "Unidentified function or variable 'PulsePal', you did not successfully add PulsePal to the MATLAB path.

Note: If you are not using Psychtoolbox, for MATLAB to recognize Pulse Pal's serial port under Linux, the port needs to be explicitly added in MATLAB's java.opts file. The first time you run PulsePal, if no java.opts file is present, PulsePal will attempt to add one.

If this fails, you will be prompted to do the following:

1. Open a terminal window.

2. Copy java.opts from: /PulsePal/MATLAB/java.opts to: /usr/local/MATLAB/R2011a/bin/glnxa64 (where R2011a is your MATLAB release).

Any other error messages indicate that Pulse Pal was found but there is a problem with the software or hardware. Please report software bugs to us on the forum, so we can make the system better for everyone.

GNU Octave

Support for GNU Octave 4 was added on 3, February 2016. All functions should work except for the MATLAB GUI.

To use Pulse Pal on GNU Octave 4, you need to add the Instrument Control Package, version 0.2.1 or newer.

1. Install Instrument Control Package.

2. Add the folder /PulsePal/MATLAB/ to the Octave path, OR navigate to this folder in the current directory bar.

3. Start Pulse Pal with a serial port argument: PulsePal('MySerialPort') where 'MySerialPort' is a string with your serial port name (e.g. 'COM3' in Windows, '/dev/ttyACM0' in Ubuntu). For Pulse Pal 1, this will appear as a "Leaflabs Maple" serial port in the device manager. For Pulse Pal 2, it will appear as "Arduino Due".

If all went well, Pulse Pal will connect.

If you see an error that says "error: 'PulsePal' undefined near line 1 column 1', you did not successfully add PulsePal to the MATLAB path.

Any other error messages indicate that Pulse Pal was found but there is a problem with the software or hardware. Please report software bugs to us on the forum, so we can make the system better for everyone.