learningMatlab

Overall aim

Design and write code for a simple orientation discrimination experiment.

To remind you of the details, you can have a look back at the summary of what we want to achieve

From last time

By the next session you should be able to present your progress at the front of class for ~5min. You should have:

[…]

b. you should also have written a function(s) to get the required information from both the experimenter getExperimentParams() and the subject getSubjectInfo() as outlined in points 3, 4, and 5 in the specification. We’ll show your code snippets and get you to talk through it…

[…]

The function definitions for those two functions should look something like the following. Remember that the function getExperimentParams() should return 3 things

function [filename, nTrials, orientations] = getExperimentParams()
...
end

and for getting consent from the subject, a function that just returns one argument, a logical value that is either true or false, specifying whether the subject has consented by pressing YES.

function [hasConsented] = getSubjectInfo()
...
end

To see a worked solution of those two functions, you can look at the m-files in this folder.

This session’s aims

Making sure MGL is on the path

You need to make sure that MGL is “on Matlab’s path” (so Matlab knows where the MGL functions are stored on your computer).

In the computer labs at Psychology, the following will do the trick:

addpath(genpath('/Volumes/practicals/ds1/mgl/'))

If you have a local copy of the MGL toolbox, then replace the '/Volumes/practicals/ds1/mgl/' with the location of the MGL folder you downloaded.

Helpful commands

Try looking up help for the following things

help mglOpen
mglTestDots(0)
edit mglTestDots % look at the code