Skip to content

Instantly share code, notes, and snippets.

@carrien
carrien / gen_expt_data.m
Last active April 23, 2019 21:05
Template expt and data generation
subjPaths = {'/path/to/subjectfolder1/', '/path/to/subjectfolder2/', '/path/to/subjectfolder3/'};
nsubjects = length(subjPaths);
expt.vowels = {'u', 'y'};
expt.words = {'u', 'y'};
expt.conds = {'training'};
nvowels = length(expt.vowels);
ntrials = 50; % trials per vowel -- if different between subjects, define this in the loop
@carrien
carrien / taxrates.ipynb
Last active November 12, 2016 01:59
Tax rate comparison
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@carrien
carrien / run_speaklisten_ptb.m
Created October 22, 2016 18:58
Speak-listen experiment (for, e.g. speaking-induced suppression in MEG).
function [expt] = run_speaklisten_ptb(snum,dataPath,usetrigs,practicemode,manualmode)
if nargin < 1 || isempty(snum), snum = 0; end
if nargin < 2 || isempty(dataPath), dataPath = cd; end
if nargin < 3 || isempty(usetrigs), usetrigs = 1; end
if nargin < 4 || isempty(practicemode), practicemode = 0; end
if nargin < 5 || isempty(manualmode), manualmode = 0; end
% check for pre-existing dir and output files
if ~exist(dataPath,'dir')
@carrien
carrien / run_fliptest.m
Created June 7, 2016 17:31
Flip timing test
function [expt] = run_fliptest()
%% setup
ntrials = 50; % number of trials per block
stimdur = .1; % time stim is on screen, in seconds
interstimdur = .05; % minimum time between stims, in seconds
interstimjitter = .05; % maximum extra time between stims (jitter)
% psychtoolbox
AssertOpenGL; % Running on PTB-3? Abort otherwise.