• API
• FAQ
• Tools
• Archive
SHARE
TWEET

# Untitled

a guest Jun 18th, 2019 62 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
1. Ts=.008;
2. WIN=.5;
3. ORD=3;
4. truncate = floor(WIN/Ts/2);
5.
6. % Do the x position -> velocity
7. [x_f, vx] = polyreg(x,t,Ts,WIN,ORD);
8. % Do the x position
9. [y_f, vy] = polyreg(y,t,Ts,WIN,ORD);
10. % Do the z position
11. [z_f, vz] = polyreg(z,t,Ts,WIN,ORD);
12.
13. % recalculate a new range of t, because the xd is shorter than x by
14. % floor(WIN/Ts/2)
15. % remove from the beginning and the end
16. td = t(truncate+1:length(t)-truncate);
17.
18. % velocity -> acceleration
19. [vx_f, ax] = polyreg(vx',td,Ts,WIN,ORD);
20. [vy_f, ay] = polyreg(vy',td,Ts,WIN,ORD);
21. [vz_f, az] = polyreg(vz',td,Ts,WIN,ORD);
22.
23. % further truncation we lost data above.
24. tdd = td(truncate+1:length(td)-truncate);
25.
26. omega1=omega1(truncate+1:length(td)-truncate);
27. omega2=omega2(truncate+1:length(td)-truncate);
28. omega3=omega3(truncate+1:length(td)-truncate);
29. omega4=omega4(truncate+1:length(td)-truncate);
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy.

Top