matlab(tdcs): assert reference group present; README scope note

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Experiments DB Dev
2026-07-20 08:08:27 -04:00
parent 01f59a5265
commit 13414d31fc
2 changed files with 12 additions and 0 deletions
+2
View File
@@ -66,6 +66,8 @@ groupCell = groupCell(dayMask);
% level). Only categories actually present after merge+window survive.
S.group = categorical(groupCell);
allCats = categories(S.group);
assert(ismember(cfg.ref, allCats), 'tdcs_scenario_data:refMissing', ...
'Reference group "%s" is absent from scenario "%s".', cfg.ref, char(scenario));
otherCats = allCats(~strcmp(allCats, cfg.ref));
S.group = reordercats(S.group, [{cfg.ref}; otherCats]);