help > RE: block-design onsets/durations
Nov 12, 2019  02:11 AM | Alfonso Nieto-Castanon - Boston University
RE: block-design onsets/durations
Hi Sahil,

conditions.names should only contain the names of your 4 conditions (no need to repeat that across subjects), e.g.
batch.Setup.conditions.names={'Fdb_Rew','Fdb_Pun','Fdb_App','Fdb_Avo'};

and conditions.onsets and durations should be defined as a nested array instead of a double array, e.g.
batch.Setup.conditions.durations{ncondition}{nsubject}={[1516]};

instead of batch.Setup.conditions.durations{ncondition, nsubject}={[1516]}

Hope this helps
Alfonso
Originally posted by Sahil Bajaj:
Hi experts,

I am using 3rd option here and I defined my condition names, onsets and durations for 4 conditions for 5 subjects as following:

batch.Setup.conditions.names
ans =
4×5 cell array
{'Fdb_Rew'} {'Fdb_Rew'} {'Fdb_Rew'} {'Fdb_Rew'} {'Fdb_Rew'}
{'Fdb_Pun'} {'Fdb_Pun'} {'Fdb_Pun'} {'Fdb_Pun'} {'Fdb_Pun'}
{'Fdb_App'} {'Fdb_App'} {'Fdb_App'} {'Fdb_App'} {'Fdb_App'}
{'Fdb_Avo'} {'Fdb_Avo'} {'Fdb_Avo'} {'Fdb_Avo'} {'Fdb_Avo'}

>> batch.Setup.conditions.onsets
ans =
4×5 cell array
{1×42 double} {1×50 double} {1×44 double} {1×19 double} {1×16 double}
{1×15 double} {1×33 double} {1×16 double} {1×11 double} {1×20 double}
{1×57 double} {1×83 double} {1×60 double} {1×30 double} {1×36 double}
{1×51 double} {1×25 double} {1×48 double} {1×78 double} {1×72 double}

>> batch.Setup.conditions.durations
ans =
4×5 cell array
{[1516]} {[1516]} {[1516]} {[1516]} {[1516]}
{[1516]} {[1516]} {[1516]} {[1516]} {[1516]}
{[1516]} {[1516]} {[1516]} {[1516]} {[1516]}
{[1516]} {[1516]} {[1516]} {[1516]} {[1516]}

After I try to load this batch in conn as conn_batch(batch);

I get following error:
Brace indexing is not supported for variables of this type.

Error in conn_batch (line 1013)
CONN_x.Setup.conditions.values{nsub}{nl0+nconditions}{nses}={batch.Setup.conditions.onsets{nconditions}{isub}{nses},batch.Setup.conditions.durations{nconditions}{isub}{nses}};

Please have a look at the attached screen shot.

I would really appreciate your helping in fixing this error so that I can load the above conditions data to my existing con project.

Thanks
Sahil

Threaded View

TitleAuthorDate
Daniel Yang Aug 10, 2015
Sahil Bajaj Nov 11, 2019
RE: block-design onsets/durations
Alfonso Nieto-Castanon Nov 12, 2019
Sahil Bajaj Nov 12, 2019
Alfonso Nieto-Castanon Aug 10, 2015