distance.m

来自「多智能体工具包」· M 代码 · 共 28 行

M
28
字号
% DISTANCE	Distance change between object and goal when pushing box.

%     Copyright (c) 1998-2000 Jiming Liu and Jianbing Wu

close all;
clear all;

FLname='d:\users\jbwu\circ\result\circ01';

eval(['load ' FLname ';']);

BeginPoint=1;
EndPoint=118;

TheDistance=[];
OHistory=ObjectHistory(BeginPoint:EndPoint,:);
GHistory=GoalHistory(BeginPoint:EndPoint,:);

for mm=BeginPoint:EndPoint
  OGDiff=OHistory(mm,:)-GHistory(mm,:);
  TheDistance=[TheDistance sqrt(OGDiff(1)*OGDiff(1)+OGDiff(2)*OGDiff(2))];
end;
plot(TheDistance);

xlabel('t');
ylabel('Distance between Object and Goal');
grid on;

⌨️ 快捷键说明

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