a=load('traject=up_max2minTorque#T=50#M=m42#ki012kp016#t_pos_vel_curr_posTh_velTh.txt');

time=a(:,1);
velocity=a(:,3);
current=a(:,4);

ts=time(end)/(length(time)-1);
advance=floor(0.200/ts);
current3=[zeros(advance,1); current(1:end-advance)];

current2=zeros(length(current),1);
for i=1:length(time)
    start=i-advance;
    if (start<1), start=1; end
    current2(i)=sum(current(start:i))/(i-start+1);
end

%velocity2=velocity+(velocity==0);

plot(time,-velocity,time,current,time,current3);