修改A*的命令窗口输出

This commit is contained in:
Cx330 committed 2025-06-02 19:45:44 +08:00
1 parent 16609a6699
commit 53270692e9
1 file changed
+9 -1
+9 -1
View File
@@ -61,5 +61,13 @@ while ~isequal(node(4:5),initial)
path=[node(4:5); path];
node=closed(BinA(closed(:,1:2),node(4:5)),:);
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