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
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 subjectgetSubjectInfo()
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
filename
, where you want to save your results, ultimatelynTrials
(or whatever you want to call it inside your function) that specifies how many trials we want to run.orientations
that contains the orientations we want to pick from for our stimulifunction [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.
function screenNumber = initializeScreen(screenNumber)
% initialize the screen for MGL
...
end
function closeScreen()
% closeScreen - close the MGL screen and say bye!
...
end
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.
Try looking up help for the following things
help mglOpen
mglTestDots(0)
edit mglTestDots % look at the code