help > using .mat for durations in batch
Showing 1-1 of 1 posts
Display:
Results per page:
Sep 24, 2017  05:09 PM | hnh
using .mat for durations in batch
Dear conn-users and -experts, 

I have a new question regarding the condition part of the batch file. In my experiments, the onsets and durations are stored in the variable onsets.mat. I guess there must be a way to use those files with the batch file, isn't there? 
I'm wondering why I haven't found an example from the community yet, even though this format is common in SPM for multiple conditions? 
Anyway, I'd be grateful if somebody could help or give me a hint how to load the onsets and durations from the variable. 
Thank you very much!! Hannah

for ncond = 1:1
for nsub=1:numel(SubjectFolder)
for nses=1:numel(SessionSubFolder)
onsetfile=load(fullfile(cwd,SubjectFolder{nsub},OnsetFolder,'onsets.mat'),'onsets');
batch.Setup.conditions.onsets{ncond}{nsub}{nses} = 'onsetsfile.onsets';
%batch.Setup.conditions.durations{ncond}{nsub}{nses} = onsets.durations;
end
end
end