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

📄 graph_shortest_path.m

📁 %The Metabolic Networks Toolbox contains functions to create, %modify, display, and simulate bioche
💻 M
字号:
% r = graph_shortest_path(A,maxdist,check)%% compute matrix 'r' of shortest distances% if distance > maxdist, set element -1%% A adjacency matrixfunction r = graph_shortest_path(A,maxdist,check)if ~exist('maxdist'), maxdist=30; endif ~exist('check'), check=1; endif check, A = (A~=0); A = A - diag(diag(A));end A=sparse(A);r = nan*ones(size(A));for i=1:maxdist%i  ind = isnan(r).* ((A^i) ~= 0);  r(find(ind))=i;end  r(find(r==0))=-1;for k=1:size(r,1), r(k,k)=0; end

⌨️ 快捷键说明

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