snippet from https://www.nitrc.org/projects/hitachi2nirs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% 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