clc
clear
clf

oc_z = oc_zdvih_1_2;

L_oc=length(oc_z);
T_oc=zeros(1,L_oc);

for i=2:L_oc
    T_oc(1,i)=T_oc(1,i-1)+0.02;
end

figure(1);
clf
plot(T_oc,oc_z,'b-');
title('zdvih');xlabel('čas [s]');ylabel('zdvih [mm]');

oc_r=gradient(oc_z(:))./gradient(T_oc(:));
figure(2);
clf
plot(T_oc,oc_r,'b-');
title('rychlost');xlabel('čas [s]');ylabel('rychlost [mm/s]');

oc_a=gradient(oc_r(:))./gradient(T_oc(:));
figure(3);
clf
plot(T_oc,oc_a,'b-');
title('zrychlení');xlabel('čas [s]');ylabel('zrychlení [mm/s^2]');

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
mc_z = mc_zdvih_1_2;

L_mc=length(mc_z);
T_mc=zeros(1,L_mc);

for i=2:L_mc
    T_mc(1,i)=T_mc(1,i-1)+0.02;
end

figure(1);
hold on;
plot(T_mc+4.25,mc_z+0.25,'r-')
legend("Odporove cidlo","Magneticke cidlo");

mc_r=gradient(mc_z(:))./gradient(T_mc(:));
figure(2);
hold on;
plot(T_mc+4.25,mc_r,'r-');
legend("Odporove cidlo","Magneticke cidlo");

mc_a=gradient(mc_r(:))./gradient(T_mc(:));
figure(3);
hold on;
plot(T_mc+4.25,mc_a,'r-');
legend("Odporove cidlo","Magneticke cidlo");
