Over the course of a four year Doctorate tens and tens of experiments were programmed in MATLAB, usually using the PsychtoolBox add-on package to display stimuli on the screen at millisecond precision and with the desired luminosity and color. The computer on which MATLAB was running was almost always linked up to an eye-tracker system.

The experimental scripts always contained:

1) code for screen parameters

2) code for the structure of the experiment (i.e. design)

3) code for the stimuli to be shown on screen (i.e. drawing of stimuli)

4) code for the actual experiment procedure (i.e. loops for what is shown where and when)

5) code for saving the participant's response

There were a number of experiments with more sophisticated procedures but all shared this basic structure at the core.

Here is an example of a simple visual experiment programmed on MATLAB, also using an eye-tracker to track the position of the eyes. Feedback was also displayed on the screen based on the position of the eyes (so if the eye movements were correct or not).

PDF version of a MATLAB SCRIPT written during the PhD


During the four year Doctorate program (2012-2016) MATLAB scripts were used to aid many aspects of daily works tasks. 

The MATLAB experiment scripts would create a text file (.txt) for every participant that was tested, after each and every block. Very soon there would be 100s of text files. A MATLAB script was created to search for the files and "stick" them together into a single large text file.

An example of this can be seen below.

PDF version of the MATLAB SCRIPT

Scripts were written in order to scan through the data and detect specific sequences of eye movements (for example data relating to the coordinates of an eye movement that first went to a bright distractor followed by a corrective eye movement to the intended target). This script was essential for the investigation that lead to the publishing of an article on sequences of eye movements (see below).

PDF version of the MATLAB SCRIPT

Final article based on the script

Scripts were also written to automatically calculate and display on the screen graphs of performance for the participants, for them to understand how well they were performing during the experiments. An example of this is below.

PDF version of the MATLAB SCRIPT

MATLAB was also used to produce maps of eye movements (see the Data Analysis section -> Mapping and Density Plots)

Geneva, Switzerland