⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 plotfig7.m

📁 nn modelling and auto-pid controller
💻 M
字号:
% script file to recreate figure 7 from%   A.W.Merz, "The Game of Two Identical Cars", pp.324 -- 343%	Journal of Optimization Theory and Applications, 9, 5 (1972)%% Ian Mitchell, 1/21/01slices = [ -180; -150; -120; -90; -60; -30 ] * pi / 180;beta = 0.5;scale = [ 1, 1, 180 / pi ];aspect = scale;closeCircle = 1;colors = { 'b'; 'b'; 'b' };styles = { '-'; '-'; '-' };%styles = { '-'; '--'; '-.' };%colors = { 'b'; 'r'; 'm' };%styles = { 'x-'; 's-'; 'o-' };plotSpecial = 1;specialStyles = { '*', 's', 'v', 'o' };specialNames = { 'crossover', 'single', 'curved', 'straight' };if(closeCircle)  cx = beta * scale(1) * cos(0 : pi/90 : 2*pi);  cy = beta * scale(2) * sin(0 : pi/90 : 2*pi);end%figure;hold on;for i = 1:length(slices)  [ xp xm xc sp sm ] = barrier(slices(i), beta);  scalep = repmat(scale, size(xp, 1), 1);  scalem = repmat(scale, size(xm, 1), 1);  scalec = repmat(scale, size(xc, 1), 1);  xp = xp .* scalep;  xm = xm .* scalem;  xc = xc .* scalec;  plot3(xp(:,1), xp(:,2), xp(:,3), [ colors{1}, styles{1} ], ...	xm(:,1), xm(:,2), xm(:,3), [ colors{2}, styles{2} ], ...	xc(:,1), xc(:,2), xc(:,3), [ colors{3}, styles{3} ]);  if(plotSpecial)    pts = { sp.crossover; sp.single; sp.curved; sp.straight; ...            sm.crossover; sm.single; sm.curved; sm.straight };    for j = 1 : length(pts)      pt = repmat(scale', 1, size(pts{j}, 2)) .* pts{j};      color = colors{fix((j - 1) / length(specialNames)) + 1};      style = specialStyles{rem((j - 1), length(specialNames)) + 1};      if(~isempty(pt))        plot3(pt(1), pt(2), pt(3), [ color, style ]);      end    end  end  if(closeCircle)    cz = xc(1,3) * ones(size(cx));    plot3(cx, cy, cz, 'b:');  endenddaspect(aspect);view(2);grid on;xlabel('x');  ylabel('y');  zlabel('\theta');

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -