function xbeta_divvy_up_params_session(subj_name, curr_var, curr_type, dest_path)
% -------------------------------------
% Utility script to break results of a big roi_stats run
% into several .mat files usable for later extraction.
% Doesn't do averaging across sessions.


for i = 1:length(curr_var)
    curr_stats{i}.mean = curr_var{i}.mean;
    curr_stats{i}.min = curr_var{i}.min;
    curr_stats{i}.max = curr_var{i}.max;
    curr_stats{i}.var = curr_var{i}.var;
    curr_stats{i}.n = curr_var{i}.n;

    eval([subj_name '_' curr_var{i}.name '_' curr_type ' = curr_stats{i};']);
    eval(['savename_' curr_type ' = fullfile(dest_path, ''' subj_name '_' curr_type '_xbeta.mat'');']);
    eval(['save(savename_' curr_type ', ''' subj_name '_*_' curr_type ''', ''-mat'');']);
end
