Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Ts=.008;
- WIN=.5;
- ORD=3;
- truncate = floor(WIN/Ts/2);
- % Do the x position -> velocity
- [x_f, vx] = polyreg(x,t,Ts,WIN,ORD);
- % Do the x position
- [y_f, vy] = polyreg(y,t,Ts,WIN,ORD);
- % Do the z position
- [z_f, vz] = polyreg(z,t,Ts,WIN,ORD);
- % recalculate a new range of t, because the xd is shorter than x by
- % floor(WIN/Ts/2)
- % remove from the beginning and the end
- td = t(truncate+1:length(t)-truncate);
- % velocity -> acceleration
- [vx_f, ax] = polyreg(vx',td,Ts,WIN,ORD);
- [vy_f, ay] = polyreg(vy',td,Ts,WIN,ORD);
- [vz_f, az] = polyreg(vz',td,Ts,WIN,ORD);
- % further truncation we lost data above.
- tdd = td(truncate+1:length(td)-truncate);
- omega1=omega1(truncate+1:length(td)-truncate);
- omega2=omega2(truncate+1:length(td)-truncate);
- omega3=omega3(truncate+1:length(td)-truncate);
- omega4=omega4(truncate+1:length(td)-truncate);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement