Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [t,z]=ode45(@robot, 0:0.01:15, [5;1;pi/4])
- plot( z(:,1), z(:,2))
- function dz=robot(t,z)
- x=z(1);
- y=z(2);
- theta=z(3);
- alfa=atan2(y,x)-theta;
- beta=atan2(y,x);
- e=sqrt(x^2+y^2)
- v=-e*cos(alfa);
- w=cos(alfa)*sin(alfa)+beta*cos(alfa)*sin(alfa)/alfa;
- dz=[v*cos(theta) ;...
- v*sin(theta) ;...
- w];
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement