% use numerical integration and plot % steering for bicycle model of car % init condx [theta ya xb yb] L = 0.3; % car length m theta = 0.0; ya = 0.25; % parallel to line, 0.25 m offset xb = -L * cos(theta); yb =ya +L * sin(theta); y0 = [theta ya xb yb]; t0 = 0.0; tf = 5; tspan = [t0 tf]; % simulate for 20 seconds [t,y] = ode45('bicycle',tspan,y0); % You can try ode15s if you have any problems on ode45. y1=y(:,1); % orientation wrt line y2=y(:,2); % offset wrt line of front of car y3=y(:,3); % longitudinal position of back of car y4=y(:,4); % lateral posiiton of back of car plot(y3,y4);