label='ankle_angle_r';
%
%qo=read_motionFile('original.sto');
%qo.data(:,2:end)=qo.data(end:-1:1,2:end);
%write_motionFile(qo,'reversed.sto');
%
%fo=read_motionFile('filtered_original.sto');
%fr=read_motionFile('filtered_reversed.sto');
%
%fo2=storage_differentiate(fo,2);
%fr2=storage_differentiate(fr,2);
%
%plot_columns({fo fr},label);
%plot_columns({fo2 fr2},label);

%q0=read_motionFile('STATES0.sto');
%q0.data=q0.data(1:end,:);
%q0.data(:,2:end) = q0.data(:,2:end)*180/pi;
%q1=read_motionFile('STATES1.sto');
%q1.data=q1.data(1:end,:);
%q1.data(:,2:end) = q1.data(:,2:end)*180/pi;
%rq=read_motionFile('Results.baseline/subject01_walk1_RRA1_Kinematics_q.sto');
%ru=read_motionFile('Results.baseline/subject01_walk1_RRA1_Kinematics_u.sto');
%rdudt=read_motionFile('Results.baseline/subject01_walk1_RRA1_Kinematics_dudt.sto');
%
%plot_columns({q0 rq},label);
%plot_columns({q0 ru},label);
%plot_columns({q1 ru},label);
%plot_columns({q1 rdudt},label);


%t0=read_motionFile('output0.sto');
%t1=read_motionFile('output1.sto');
%t2=read_motionFile('output2.sto');
%et0=read_motionFile('extract/output0.sto');
%et1=read_motionFile('extract/output1.sto');
%et2=read_motionFile('extract/output2.sto');
%
%%plot_columns({t2 t1 t0},label);
%%plot_columns({t0 et0},label);
%%plot_columns({t1 et1},label);
%plot_columns({t2 et2},label);


%t1=read_motionFile('TEST1.sto');
%t2=read_motionFile('TEST2.sto');
%tq0=read_motionFile('TESTq0.sto');
%tq1=read_motionFile('TESTq1.sto');
%tq2=read_motionFile('TESTq2.sto');
%f=storage_differentiate(tq0,1);
%ff=storage_differentiate(tq0,2);
%
%plot_columns(t1,label);
%plot_columns(t2,label);
%plot_columns(tq0,label);
%plot_columns({f tq1},label);
%plot_columns({ff tq2},label);

%q1_bad=read_motionFile('filter_bad/TESTq1.sto');
%q2_bad=read_motionFile('filter_bad/TESTq2.sto');
%q1_fixed=read_motionFile('filter_fixed_resample/TESTq1.sto');
%q2_fixed=read_motionFile('filter_fixed_resample/TESTq2.sto');
%plot_columns({q1_bad q1_fixed},label);
%plot_columns({q2_bad q2_fixed},label);

%id_20_0=read_motionFile('ResultsAnalyze/id_20_splinefit0.sto');
%id_20_1=read_motionFile('ResultsAnalyze/id_20_splinefit1.sto');
%id_20fd_1=storage_differentiate(id_20_1,1); %read_motionFile('ResultsAnalyze/id_20fd_splinefit1.sto');
%id_8_1=read_motionFile('ResultsAnalyze/id_8_splinefit1.sto');
%id_8fd_1=storage_differentiate(id_8_1,1); %read_motionFile('ResultsAnalyze/id_8fd_splinefit1.sto');
%
%plot_columns({id_20_0 id_8_0},label);
%plot_columns({id_20_1 id_8_1},label);
%plot_columns({id_20fd_1 id_8fd_1},label);
%plot_columns({id_20fd_1 id_20_1},label);
%plot_columns({id_8fd_1 id_8_1},label);

id_int=read_motionFile('ResultsAnalyze/test1_InverseDynamics_force.sto');
id_ext=read_motionFile('ResultsAnalyze/test2_InverseDynamics_force.sto');
plot_columns({id_int id_ext});

%baseline=read_motionFile('Results.baseline/subject01_walk1_RRA1_Actuation_force.sto');
%id_20=read_motionFile('ResultsAnalyze/id_20_InverseDynamics_force.sto');
%id_20fd=read_motionFile('ResultsAnalyze/id_20fd_InverseDynamics_force.sto');
%id_8=read_motionFile('ResultsAnalyze/id_8_InverseDynamics_force.sto');
%id_8fd=read_motionFile('ResultsAnalyze/id_8fd_InverseDynamics_force.sto');
%
%%plot_columns({baseline id_20 id_8},'F[XYZ]')
%%plot_columns({baseline id_20fd id_8fd},'F[XYZ]')
%%plot_columns({baseline id_20 id_20fd},'F[XYZ]')
%%plot_columns({baseline id_8 id_8fd},'F[XYZ]')
%plot_columns({baseline id_20},'F[XYZ]')


%id1=read_motionfile('resultsanalyze/id1_inversedynamics_force.sto');
%id2=read_motionfile('resultsanalyze/id2_inversedynamics_force.sto');
%id3=read_motionfile('resultsanalyze/id3_inversedynamics_force.sto');
%id4=read_motionfile('resultsanalyze/id4_inversedynamics_force.sto');
%id5=read_motionfile('resultsanalyze/id5_inversedynamics_force.sto');
%id6=read_motionfile('resultsanalyze/id6_inversedynamics_force.sto');
%id_20=read_motionfile('resultsanalyze/id_20_inversedynamics_force.sto');
%id_8=read_motionfile('resultsanalyze/id_8_inversedynamics_force.sto');

%plot_columns({id1,id2,id3,id4,id5},'F[XYZ]')
%plot_columns({id1,id5,id6},'F[XYZ]')
%plot_columns({id4,id5,id6},'F[XYZ]')
%plot_columns({id_20 id_8},'F[XYZ]')

%ik=read_motionFile('subject01_walk1_ik.mot');
%rra_q=read_motionFile('Results.baseline/subject01_walk1_RRA1_Kinematics_q.sto');
%rra_dudt=read_motionFile('Results.baseline/subject01_walk1_RRA1_Kinematics_dudt.sto');
%rra_y=read_motionFile('Results.baseline/subject01_walk1_RRA1_states.sto');
%
%rra_y.data(:,2:end) = rra_y.data(:,2:end) * 180/pi;
%
%
%plot_columns({ik,rra_q,rra_y},[label '$']);
%
%ik_DIFF = storage_differentiate(ik,5);
%rra_q_DIFF = storage_differentiate(rra_q,2);
%rra_y_DIFF = storage_differentiate(rra_y);
%
%plot_columns({rra_q_DIFF,rra_dudt,rra_y_DIFF},label);
