A bug in neurostim.design (in subsasgn()) caused multiple calls to
.conditions() to always overwrite the previous contents of .conditionSpecs
if the last factor in the factorial was a singleton. This was because
ndims(o.conditionSpecs) returned [N M] even if the factorial had three
factors, i.e., was actually N x M x 1. This was true for all factorial
designs with >2 factors where the last factor was a singleton.
The fix provided here initializes o.conditionSpecs to a cell array (of
appropriate dimensions to match the factorial) of empty matricies on the
first call to .conditions(), and concatenates the contents of
.conditionSpecs thereafter.
A bug in neurostim.design (in subsasgn()) caused multiple calls to .conditions() to always overwrite the previous contents of .conditionSpecs if the last factor in the factorial was a singleton. This was because ndims(o.conditionSpecs) returned [N M] even if the factorial had three factors, i.e., was actually N x M x 1. This was true for all factorial designs with >2 factors where the last factor was a singleton.
The fix provided here initializes o.conditionSpecs to a cell array (of appropriate dimensions to match the factorial) of empty matricies on the first call to .conditions(), and concatenates the contents of .conditionSpecs thereafter.