修改A*的命令窗口输出
This commit is contained in:
parent
16609a6699
commit
53270692e9
@ -61,5 +61,13 @@ while ~isequal(node(4:5),initial)
|
|||||||
path=[node(4:5); path];
|
path=[node(4:5); path];
|
||||||
node=closed(BinA(closed(:,1:2),node(4:5)),:);
|
node=closed(BinA(closed(:,1:2),node(4:5)),:);
|
||||||
end
|
end
|
||||||
path
|
% 打印路径
|
||||||
|
if ~isempty(path)
|
||||||
|
disp('路径为:');
|
||||||
|
for i = 1:size(path, 1)
|
||||||
|
fprintf('(%d, %d)\n', path(i, 2), path(i, 1));
|
||||||
|
end
|
||||||
|
else
|
||||||
|
disp('未找到路径。');
|
||||||
|
end
|
||||||
end
|
end
|
Loading…
x
Reference in New Issue
Block a user