matlab(tdcs): report, switch/case entry, runners, README
This commit is contained in:
@@ -0,0 +1,64 @@
|
||||
function tdcs_glm(scenario)
|
||||
%TDCS_GLM Run one tDCS GLM scenario end-to-end and report it.
|
||||
% TDCS_GLM(SCENARIO) runs the full pipeline for one named scenario --
|
||||
% TDCS_SCENARIO_DATA -> TDCS_MODELS -> TDCS_REPORT -- printing the
|
||||
% report to the console and writing it to
|
||||
% analysis/matlab/results/<SCENARIO>.txt.
|
||||
%
|
||||
% SCENARIO must be one of (case-sensitive):
|
||||
% unmerged_full, unmerged_d0_10,
|
||||
% mergeA2_full, mergeA2_d0_10,
|
||||
% mergeB2_full, mergeB2_d0_10
|
||||
%
|
||||
% Each case below is a self-contained, independently invocable call of
|
||||
% the same three-function pipeline; they are enumerated explicitly
|
||||
% (rather than sharing one generic branch) so each scenario name is
|
||||
% greppable on its own, per the project's spec.
|
||||
%
|
||||
% Example:
|
||||
% tdcs_glm('mergeB2_full')
|
||||
%
|
||||
% See analysis/tdcs_glm.py (the Python this ports) and
|
||||
% docs/superpowers/plans/2026-07-20-matlab-tdcs-analysis.md (Task 4).
|
||||
|
||||
cfg = tdcs_config();
|
||||
|
||||
switch scenario
|
||||
case 'unmerged_full'
|
||||
[S, meta] = tdcs_scenario_data('unmerged_full');
|
||||
R = tdcs_models(S, meta, cfg);
|
||||
tdcs_report(S, R, meta, cfg, 'unmerged_full');
|
||||
|
||||
case 'unmerged_d0_10'
|
||||
[S, meta] = tdcs_scenario_data('unmerged_d0_10');
|
||||
R = tdcs_models(S, meta, cfg);
|
||||
tdcs_report(S, R, meta, cfg, 'unmerged_d0_10');
|
||||
|
||||
case 'mergeA2_full'
|
||||
[S, meta] = tdcs_scenario_data('mergeA2_full');
|
||||
R = tdcs_models(S, meta, cfg);
|
||||
tdcs_report(S, R, meta, cfg, 'mergeA2_full');
|
||||
|
||||
case 'mergeA2_d0_10'
|
||||
[S, meta] = tdcs_scenario_data('mergeA2_d0_10');
|
||||
R = tdcs_models(S, meta, cfg);
|
||||
tdcs_report(S, R, meta, cfg, 'mergeA2_d0_10');
|
||||
|
||||
case 'mergeB2_full'
|
||||
[S, meta] = tdcs_scenario_data('mergeB2_full');
|
||||
R = tdcs_models(S, meta, cfg);
|
||||
tdcs_report(S, R, meta, cfg, 'mergeB2_full');
|
||||
|
||||
case 'mergeB2_d0_10'
|
||||
[S, meta] = tdcs_scenario_data('mergeB2_d0_10');
|
||||
R = tdcs_models(S, meta, cfg);
|
||||
tdcs_report(S, R, meta, cfg, 'mergeB2_d0_10');
|
||||
|
||||
otherwise
|
||||
error('tdcs_glm:badScenario', ...
|
||||
['Unrecognized scenario "%s". Valid scenarios are: ' ...
|
||||
'unmerged_full, unmerged_d0_10, mergeA2_full, mergeA2_d0_10, ' ...
|
||||
'mergeB2_full, mergeB2_d0_10.'], scenario);
|
||||
end
|
||||
|
||||
end
|
||||
Reference in New Issue
Block a user