Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- for x=-9:10
- for y=-9:10
- [t,z]=ode45(@robot, 0:0.01:15, [x;y;pi/4]);
- hold on
- plot( z(:,1), z(:,2))
- end
- end
- 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=alfa+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