a2a812acc8
Add variation_plot.m + make_variation_plot.m, dropping plotcurve.m +
learning_curve.png into all 28 variation folders. Each figure plots mean +/-
SEM successful reaches per training day for the anodal/treatment group (red)
vs control (blue), in the style of the paper ("Lines indicate mean (and SEM)
across animals in the anodal (red) and control (blue) groups"). Per-group N is
read from the data and shown in the legend; training day is 1-indexed (our day
0 = paper Day 1). Headless via exportgraphics. prev_f_full reproduces the
paper's own figure (anodal N=12 vs control N=12).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
29 lines
1008 B
Matlab
29 lines
1008 B
Matlab
function make_variation_plot()
|
|
%MAKE_VARIATION_PLOT Add a paper-style learning-curve figure to each variation.
|
|
% MAKE_VARIATION_PLOT() copies variation_plot.m into every variations/<name>/
|
|
% folder with a data.csv (as plotcurve.m) and runs it, producing
|
|
% learning_curve.png (mean +/- SEM successes per training day, anodal red vs
|
|
% control blue). Re-runnable; picks up new folders.
|
|
|
|
thisDir = fileparts(mfilename('fullpath'));
|
|
template = fullfile(thisDir, 'variation_plot.m');
|
|
root = fullfile(thisDir, 'variations');
|
|
|
|
d = dir(root);
|
|
n = 0;
|
|
for i = 1:numel(d)
|
|
if ~d(i).isdir || ismember(d(i).name, {'.', '..'}); continue; end
|
|
folder = fullfile(root, d(i).name);
|
|
if ~exist(fullfile(folder, 'data.csv'), 'file'); continue; end
|
|
copyfile(template, fullfile(folder, 'plotcurve.m'));
|
|
localRun(fullfile(folder, 'plotcurve.m'));
|
|
n = n + 1;
|
|
end
|
|
fprintf('\nAdded plotcurve.m + learning_curve.png to %d variation folders.\n', n);
|
|
|
|
end
|
|
|
|
function localRun(scriptPath)
|
|
run(scriptPath);
|
|
end
|