Installation

Requirements

Make sure that the following toolboxes are installed and added to the matlab / octave path.

For instructions see the following links:

Requirements

Used version

PsychToolBox

>=3.0.14

Matlab

>=2015b

or Octave

4.?

Tested:

  • matlab 2015b or octave 4.2.2 and PTB 3.0.14.

How to install

The easiest way to use this repository is to create a new repository by using the template PTB experiment repository: this creates a new repository on your github account with all the basic folders, files and submodules already set up. You only have to then clone the repository and you are good to go.

Download with git

1 cd fullpath_to_directory_where_to_install
2
3 # use git to download the code
4 git clone https://github.com/cpp-lln-lab/CPP_PTB.git
5
6 # move into the folder you have just created
7 cd CPP_PTB

Then get the latest commit to stay up to date:

1# from the directory where you downloaded the code
2git pull origin master

To work with a specific version, create a branch at a specific version tag number

1# creating and checking out a branch that will be called version1 at the version tag v1.0.0
2git checkout -b version1 v1.0.0

Add as a submodule

Add it as a submodule in the repo you are working on.

1cd fullpath_to_directory_where_to_install
2
3# use git to download the code
4git submodule add https://github.com/cpp-lln-lab/CPP_PTB.git

To get the latest commit you then need to update the submodule with the information on its remote repository and then merge those locally.

1git submodule update --remote --merge

Remember that updates to submodules need to be committed as well.

Example for submodule usage

So say you want to clone a repo that has some nested submodules, then you would type this to get the content of all the submodules at once (here with my experiment repo):

1git clone --recurse-submodules https://github.com/user_name/yourExperiment.git

This would be the way to do it “by hand”

 1# clone the repo
 2git clone https://github.com/user_name/yourExperiment.git
 3
 4# go into the directory
 5cd yourExperiment
 6
 7# initialize and get the content of the first level of submodules  (CPP_PTB and CPP_BIDS)
 8git submodule init
 9git submodule update
10
11# get the nested submodules JSONio and BIDS-matlab for CPP_BIDS
12git submodule foreach --recursive 'git submodule init'
13git submodule foreach --recursive 'git submodule update'

Direct download

Download the code. Unzip. And add to the matlab path.

Pick a specific version from here.

Or take the latest commit - NOT RECOMMENDED.

Add CPP_PTB globally to the matlab path

This is NOT RECOMMENDED as this might create conflicts if you use different versions of CPP_PTB as sub-modules.

Also note that this might not work at all if you have not set a command line alias to start Matlab from a terminal window by just typing matlab. :wink:

1# from within the CPP_PTB folder
2matlab -nojvm -nosplash -r "addpath(genpath(fullfile(pwd, 'src'))); savepath(); path(); exit();"