Skip to content

Instantly share code, notes, and snippets.

@erzk
Created April 11, 2018 23:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save erzk/01bdb34377e02a4405d4da9f8099279c to your computer and use it in GitHub Desktop.
Save erzk/01bdb34377e02a4405d4da9f8099279c to your computer and use it in GitHub Desktop.
% Reading vector of stimulus markers and arranging this into the format
% required by Homer2 and storing in the variable "aux"
markertimes = [find(vector_onset>0) find(vector_onset<0)];
markers = vector_onset(markertimes);
unique_markers = unique(markers);
aux = zeros(count, length(unique_markers));
for stimuli=1:length(unique_markers)
if offset == 'y' || offset == 'Y' % Version 3
stim_on_off = find(vector_onset==(unique_markers(stimuli))); % Version 3
stim_markers = stim_on_off(1:2:length(stim_on_off)-1); % Version 3
aux(stim_markers,stimuli) = 1; % Version 3
else % Version 3
stim_markers = find(vector_onset==(unique_markers(stimuli)));
aux(stim_markers,stimuli) = 1;
end % Version 3
end
ml = SD.MeasList;
% As the stimulus markers are stored in "aux", the stimulus matrix "s" still
% needs to be created. This is set to zeroes for now.
s = zeros(size(t))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment