channels={'center_of_mass_X', 'center_of_mass_Y'};
%channels={'ankle_angle_r','ankle_angle_l','knee_angle_r','knee_angle_l'};
%close all
for i=1:length(channels)
    label=channels{i};
    f=read_motionFile(sprintf('../FORWARD/Results/GIL04_xslow1_BodyKinematics_acc.sto',label));
    q1=read_motionFile(sprintf('ResultsNew/GIL04_xslow1_%s_deltaA_dt_0.030_df_1.000.sto',label));
    %q2=read_motionFile(sprintf('ResultsNew/GIL04_xslow1_%s_deltaA_dt_0.030_df_1.000.sto',label));
    q2=read_motionFile(sprintf('ResultsFixedCOP/GIL04_xslow1_%s_deltaA_dt_0.030_df_1.000.sto',label));
    q3=read_motionFile(sprintf('ResultsFixedCOP/GIL04_xslow1_unperturbedAccel_dt_0.030_df_1.000.sto',label));
    %q4=read_motionFile(sprintf('ResultsNew4/GIL04_xslow1_unperturbedAccel_dt_0.030_df_1.000.sto',label));
    %q2=read_motionFile(sprintf('ResultsNew5/GIL04_xslow1_%s_deltaA_dt_0.030_df_1.000.sto',label));
    %q3=read_motionFile(sprintf('ResultsNew5/GIL04_xslow1_unperturbedAccel_dt_0.030_df_1.000.sto',label));
    %q4=read_motionFile(sprintf('ResultsNew5/GIL04_xslow1_unperturbedAccel2_dt_0.030_df_1.000.sto',label));

    f1super = f.data(:,find_columns_by_label(f.labels,label));
    f1t = f.data(:,1);

    q1super = sum(q1.data(:,2:end),2);
    q1t = q1.data(:,1);

    q2super = sum(q2.data(:,2:end),2);
    q2t = q2.data(:,1);

    q3super = q3.data(:,find_columns_by_label(q3.labels,label));
    q3t = q3.data(:,1);

    q4super = q4.data(:,find_columns_by_label(q4.labels,label));
    q4t = q4.data(:,1);

    figure
    plot(f1t,f1super,'', q3t,q3super,'x', q1t,q1super,'', q2t,q2super,'x');
    legend({'forward accel', 'new perturb accel', 'original superpos', 'fixed COP superpos'});
    %plot(f1t,f1super,'', q3t,q3super,'', q4t,q4super,'', q1t,q1super,'', q2t,q2super,'');
    %legend({'forward accel', 'new perturb accel', 'newer perturb accel', 'original superpos', 'changed springs superpos'});
    %plot(q3t,q3super,'x', q4t,q4super,'x', q2t,q2super,'x');
    %legend({'new perturb accel', 'new perturb accel2', 'changed springs superpos'});
    title(label,'Interpreter','None');
end
