forward_kin=read_motionFile('ResultsForward/subject01_walk1_Kinematics_dudt.sto');
forward_bodykin=read_motionFile('ResultsForward/subject01_walk1_BodyKinematics_acc.sto');
perturb_acc=read_motionFile('ResultsPerturb/subject01_walk1_unperturbedAccel_dt_0.030_df_1.000.sto');
perturb_acc2=read_motionFile('ResultsPerturb/subject01_walk1_unperturbedAccel2_dt_0.030_df_1.000.sto');

close all;
for i=2:length(perturb_acc.labels)
    T1=perturb_acc.data(:,1);
    X1=perturb_acc.data(:,i);

    T1b=perturb_acc2.data(:,1);
    X1b=perturb_acc2.data(:,i);

    label=perturb_acc.labels{i};
    disp(sprintf('Processing %s', label));

    col = find_columns_by_label(forward_kin.labels,label);
    if col
        disp(sprintf('Found in forward_kin: %d',col));
        T2=forward_kin.data(:,1);
        X2=forward_kin.data(:,find_columns_by_label(forward_kin.labels,label));
    else
        col = find_columns_by_label(forward_bodykin.labels,label);
        if col
            disp(sprintf('Found in forward_bodykin: %d',col));
            T2=forward_bodykin.data(:,1);
            X2=forward_bodykin.data(:,find_columns_by_label(forward_bodykin.labels,label));
        end
    end

    figure;
    plot(T1, X1, '', T1b, X1b, 'r:', T2, X2, 'x');
    title(label,'Interpreter','None');
end
