[Eeglablist] Changing group/condition after precomputation

Iman Mohammad-Rezazadeh irezazadeh at ucdavis.edu
Tue Dec 1 15:01:33 PST 2015


Hi EEGLABers,
Does anyone have any SUCCESSFUL experience about changing group/condition for a subject(s) at STUDY level and after precomputation. I have been trying to write a script to change STUDY.design data ( see below) and then realized that I have to change STUDY.datasetinfo . I did that but again when I plot the subject data which I changed its grp/condition the old labels showed up in the plot. Then I found I have to change STUDY.changrp as well but it really complicated and hard to track the script.
Any suggestions?
Best,
Iman
function STUDY=Change_Subject_Var(STUDY,design_no,case_no,var_no,new_var_name)
%Change_Subject_Var(STUDY,design_no,case_no,var_no,new_var_name)
no_file=length(STUDY.design(1).cell);
for i=1:no_file
    temp_case=STUDY.design(design_no).cell(i).case;
    if strcmp(temp_case,case_no)
        STUDY.design(design_no).cell(i).value(var_no)=new_var_name;
    end
end

no_file=length(STUDY.datasetinfo);
for i=1:no_file
    temp_case=STUDY.datasetinfo(i).subject;
    if strcmp(temp_case,case_no)
        STUDY.datasetinfo(i).group=cell2mat(new_var_name);


    end
end




end


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://sccn.ucsd.edu/pipermail/eeglablist/attachments/20151201/ea4d6a60/attachment.html>


More information about the eeglablist mailing list