clear all; %% settings (transfer to exp settings file) npings=5; % total number of pings nodd=1; % number of odd pings delth=5000; % delay period length (ms) pilth=100; % ping duration (ms) minipi=400; % minimum inter-ping-interval %% command for experiment script pausvec=pingT(npings,nodd,delth,pilth,minipi) % pausvec(1): time *before* the first ping % pausvec(2:npings): time *after* each ping % pausvec(1) will be between 0 and minipi % pausvec(2) and pausvec(end) will be between 0 and minipi %% vector defining which ping is an oddball odvec=[zeros(1,npings-nodd) ones(1,nodd)]; odvec=odvec(randperm(npings)); %% subfunction doing the timing job for delay between encoding and test function pausvec=pingT(npings,nodd,delth,pilth,minipi) pausvec=NaN(1,npings+1); pausvec(1)=randsample(0:minipi,1); % pause before first ping (pilth,