資源簡介
Floyd弗洛伊德算法matlab仿真代碼。跑過幾遍,代碼是可以運行的,下載后可以直接在matlab打開運行。

代碼片段和文件信息
%?DisplayPath.m?打印路徑函數
function?DisplayPath(route?start?dest)
??%?打印出任意兩點之間的最短路徑?
??%?route?:?路由表?
??%?start?:?起點index
??%?dest?:?終點index
??
??i?=?1;
??
??while?1
????if(route(start?dest)?~=?dest)
??????fprintf(‘V%s?->?‘?num2str(start));
??????start?=?route(start?dest);
????else
??????fprintf(‘V%s?->?‘?num2str(start));
??????fprintf(‘V%s\n‘?num2str(dest));
??????break;
????end
??end
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件????????439??2019-02-26?10:38??Floyd算法MATLAB仿真\DisplayPath.m
?????文件????????475??2019-02-26?10:38??Floyd算法MATLAB仿真\Floyd.m
?????文件????????531??2019-02-26?10:38??Floyd算法MATLAB仿真\myfloyd.m
?????目錄??????????0??2019-02-26?10:38??Floyd算法MATLAB仿真
-----------?---------??----------?-----??----
?????????????????1445????????????????????4
評論
共有 條評論